Step 1: Create an AWS Config connector (optional)
Complete this step only if you want AWS Config to record the connector's GCP resources. If you don't, skip to Step 2. The AWS Config connector uses workload identity federation to let AWS Config record GCP resource state. Create it before you create the Systems Manager Cloud Connector. AWS Config allows one Config connector per host project. If your host project already has one, skip this step and use that connector's ARN in Step 2. When you use the AWS Management Console, it detects and reuses an existing Config connector for the host project.
Note
The AWS Config connector automatically creates a service-linked role for federation. You do not need to create a separate IAM role for this step.
To create an AWS Config connector for GCP
-
Create the AWS Config connector. Replace
WORKLOAD_IDENTITY_POOL_PROVIDERwith the full resource name (projects/),HOST_PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID/providers/PROVIDER_IDCONFIG_SERVICE_ACCOUNT_EMAILwith the AWS Config service account email (aws-config-), andACCOUNT_ID@HOST_PROJECT_ID.iam.gserviceaccount.comORGANIZATION_IDwith the numeric organization ID.aws configservice put-connector \ --connector-configuration '{ "gcp": { "workloadIdentityPoolProvider": "WORKLOAD_IDENTITY_POOL_PROVIDER", "serviceAccountEmail": "CONFIG_SERVICE_ACCOUNT_EMAIL", "gcpOrganizationId": "ORGANIZATION_ID" } }'Include
gcpOrganizationIdonly if the host project belongs to a GCP organization. The value must match that organization. Otherwise, omit it. To check whether the host project belongs to an organization, run the following command:gcloud projects get-ancestorsHOST_PROJECT_IDNote the
Arnfrom the response – you need it in a later step. -
Confirm the connector was created:
aws configservice list-connectorsNote
AWS Config allows one Config connector per host project. If one already exists,
put-connectorreturns aConflictException. In that case, use the existing connector's ARN fromlist-connectors.