Closed muneebmaster closed 1 month ago
This issue was also reported here: https://github.com/GoogleCloudPlatform/anthos-samples/issues/357. Creating a role with the name "AWSServiceRoleForAutoScaling" resolves the issue, however there's no indication of that in the error message. Any way to catch that or create the role through the tf scripts?
CC @GoogleCloudPlatform/anthos-multicloud to provide feedback!
@bkauf is this something you can take a look at?
From AWS DOC:
Amazon EC2 Auto Scaling creates the AWSServiceRoleForAutoScaling service-linked role for you the first time that you create an Auto Scaling group, unless you manually create a custom suffix service-linked role and specify it when creating the group.
If you are deploying Anthos to the account without any auto-scaling group created during the whole life-time of the account the role is missing.
AWS DOC encourages user to created own role AWSServiceRoleForAutoScaling with different naming (custom suffix) and use it ... however I didn't find any option how to point Anthos to the newly created role.
Ran into the same issue, had to manually create the role then update these lines to set it to the role name. It probably would make sense to have the terraform create this role so it can references it in the correct places instead of assuming it exists already.
https://github.com/GoogleCloudPlatform/anthos-samples/blob/b4ddb6cab525742af5ff446e8b8dc95f7fdef02d/anthos-multi-cloud/AWS/modules/kms/main.tf#L76 https://github.com/GoogleCloudPlatform/anthos-samples/blob/b4ddb6cab525742af5ff446e8b8dc95f7fdef02d/anthos-multi-cloud/AWS/modules/kms/main.tf#L104 https://github.com/GoogleCloudPlatform/anthos-samples/blob/b4ddb6cab525742af5ff446e8b8dc95f7fdef02d/anthos-multi-cloud/AWS/modules/iam_scope_down/main.tf#L76
Then update this line https://github.com/GoogleCloudPlatform/anthos-samples/blob/b4ddb6cab525742af5ff446e8b8dc95f7fdef02d/anthos-multi-cloud/AWS/modules/kms/main.tf#L126 and add "${data.aws_caller_identity.current.arn}"
to the list. Without this I got The new key policy will not allow you to update the key policy in the future.
Edit: Oh actually, there isn't a way to tell GKE anothos about the new Service-linked role when creating a auto scaling group so it uses the default of AWSServiceRoleForAutoScaling
which doesn't have the correct permissions...
Ouch... Good findings @rmb938 - this is an issue for sure :/
Thank you, @rmb938. Appreciate that you've shared your findings with us. We will work to add it to the sample.
Due to limit capacity the work on integrating this fix is postponed. If anyone interested to contribute to the sample by integrating these changes, please look into CONTRIBUTING.md.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days
I'm trying to deploy to AWS using https://github.com/GoogleCloudPlatform/anthos-samples/tree/main/anthos-multi-cloud/AWS and I am getting the following "error creating KMS key" errors during 'terraform apply':