From 4f7231e74e31bb844da8a577b8732acc161f94c4 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Wed, 16 Aug 2023 14:29:28 +0000 Subject: [PATCH 1/3] backport of commit 5e9516a1a45f150f8f9cd76a25a3ee1fcec11f22 --- website/content/docs/hcp/index.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/content/docs/hcp/index.mdx b/website/content/docs/hcp/index.mdx index b7af158ee..c2ec3d4b4 100644 --- a/website/content/docs/hcp/index.mdx +++ b/website/content/docs/hcp/index.mdx @@ -35,6 +35,10 @@ You can set these additional environment variables to control how metadata is pu - `HCP_PACKER_REGISTRY` - When set, Packer does not push image metadata to HCP Packer from an otherwise configured template. Allowed values are [0|OFF]. +- `HCP_PACKER_PROJECT_ID` - The ID of the HCP project to use. This is useful if your service principal has access to multiple projects, as by default Packer will pick the one created first as target. + +-> **Note**: The HCP_PACKER_PROJECT_ID environment variable must be set if you're authenticating with a project-level service principal, as otherwise Packer will attempt to get the list of projects for an organization, which will error due to a lack of permissions. This is supported starting with Packer 1.9.3; older versions of Packer do not support using project-level service principals. + ### HCP Packer Registry Block The only metadata that Packer can infer from a template with the basic configuration are the build name and build fingerprint. For HCL2 templates, we recommend adding the `hcp_packer_registry` block to your template so that you can customize the metadata that Packer sends to the registry. From 4bac593e7c1b88da334f3789c9ab34a15c9a953e Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Wed, 16 Aug 2023 14:47:43 +0000 Subject: [PATCH 2/3] backport of commit 56527bce8e3ae90e03d92dd1f04fd19aeb5282e1 --- website/content/docs/hcp/index.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/content/docs/hcp/index.mdx b/website/content/docs/hcp/index.mdx index c2ec3d4b4..1458a4309 100644 --- a/website/content/docs/hcp/index.mdx +++ b/website/content/docs/hcp/index.mdx @@ -35,6 +35,8 @@ You can set these additional environment variables to control how metadata is pu - `HCP_PACKER_REGISTRY` - When set, Packer does not push image metadata to HCP Packer from an otherwise configured template. Allowed values are [0|OFF]. +- `HCP_PACKER_ORGANIZATION_ID` - The ID of the HCP organization linked to your service principal. + - `HCP_PACKER_PROJECT_ID` - The ID of the HCP project to use. This is useful if your service principal has access to multiple projects, as by default Packer will pick the one created first as target. -> **Note**: The HCP_PACKER_PROJECT_ID environment variable must be set if you're authenticating with a project-level service principal, as otherwise Packer will attempt to get the list of projects for an organization, which will error due to a lack of permissions. This is supported starting with Packer 1.9.3; older versions of Packer do not support using project-level service principals. From cde441e53efcd9cdd66c052a2831c7ff822c31de Mon Sep 17 00:00:00 2001 From: Lucas Bajolet <105649352+lbajolet-hashicorp@users.noreply.github.com> Date: Wed, 16 Aug 2023 15:33:45 +0000 Subject: [PATCH 3/3] backport of commit aabf2581d29cb0d90d18e2c18f5a9f7793a06f28 --- website/content/docs/hcp/index.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/content/docs/hcp/index.mdx b/website/content/docs/hcp/index.mdx index 1458a4309..d908cca70 100644 --- a/website/content/docs/hcp/index.mdx +++ b/website/content/docs/hcp/index.mdx @@ -35,11 +35,11 @@ You can set these additional environment variables to control how metadata is pu - `HCP_PACKER_REGISTRY` - When set, Packer does not push image metadata to HCP Packer from an otherwise configured template. Allowed values are [0|OFF]. -- `HCP_PACKER_ORGANIZATION_ID` - The ID of the HCP organization linked to your service principal. +- `HCP_ORGANIZATION_ID` - The ID of the HCP organization linked to your service principal. This is environment variable is not required and available for the sole purpose of keeping parity with the HCP SDK authentication options. Its use may change in a future release. -- `HCP_PACKER_PROJECT_ID` - The ID of the HCP project to use. This is useful if your service principal has access to multiple projects, as by default Packer will pick the one created first as target. +- `HCP_PROJECT_ID` - The ID of the HCP project to use. This is useful if your service principal has access to multiple projects, as by default Packer will pick the one created first as target. --> **Note**: The HCP_PACKER_PROJECT_ID environment variable must be set if you're authenticating with a project-level service principal, as otherwise Packer will attempt to get the list of projects for an organization, which will error due to a lack of permissions. This is supported starting with Packer 1.9.3; older versions of Packer do not support using project-level service principals. +-> **Note**: The HCP_PROJECT_ID environment variable must be set if you're authenticating with a project-level service principal, otherwise Packer will attempt to get the list of projects for an organization and error due to a lack of permissions for a project-level service principal. This is supported starting with Packer 1.9.3; older versions of Packer do not support using project-level service principals. ### HCP Packer Registry Block