aws-samples / iam-identity-center-team

Open-source temporary elevated access solution for AWS IAM Identity Center.
https://aws-samples.github.io/iam-identity-center-team/
MIT No Attribution
310 stars 86 forks source link

Amplify build fails to deploy resources #303

Open AlexHasMe opened 1 month ago

AlexHasMe commented 1 month ago

Describe the bug Amplify build fails to deploy resources in a fresh account even though Amplify has Administrative permissions.

Logs:

CREATE_FAILED ConfigureAmplifyBucket Custom::ConfigureAmplifyS3Bucket Wed Sep 25 2024 08:55:56 GMT+0000 (Coordinated Universal Time) Received response status [FAILED] from custom resource. Message returned: See the details in CloudWatch Log Stream: 2024/09/25/[$LATEST]abc (RequestId: bfc0c842353246)

CREATE_FAILED amplify-teamidcapp-master-85223-customs3bucketSecurity-TBSZBBSU71BC AWS::CloudFormation::Stack Wed Sep 25 2024 08:55:56 GMT+0000 (Coordinated Universal Time) The following resource(s) failed to create: [ConfigureAmplifyBucket].

2024-09-25T08:56:27.239Z [INFO]: CREATE_FAILED customs3bucketSecurity AWS::CloudFormation::Stack Wed Sep 25 2024 08:56:07 GMT+0000 (Coordinated Universal Time) Embedded stack arn:aws:cloudformation:us-west-2:123:stack/amplify-teamidcapp-master-85223-customs3bucketSecurity-TBSZBBSU71BC/e4d40b90-7b1b-11ef-a517-060bed0d90b7 was not successfully created: The following resource(s) failed to create: [ConfigureAmplifyBucket].

Then:

UPDATE_ROLLBACK_IN_PROGRESS amplify-teamidcapp-master-85223 AWS::CloudFormation::Stack Wed Sep 25 2024 08:56:08 GMT+0000 (Coordinated Universal Time) The following resource(s) failed to create: [functionteamgetIdCGroups, functionteamgetOU, functionteamqueryLogs, functionteamListGroups, functionteamgetAccounts, customs3bucketSecurity, functionteamgetMgmtAccountDetails, authteam06dbb7fc]

Expected behavior Amplify successfully build and deploys AWS TEAM.

Additional context I have used Terraform instead of Cloudformation to deploy resources because Codecommit in no longer available.

saas-zach-dunton commented 1 month ago

I had the same issue, the amplify app has to be named "TEAM-IDC-APP". This is because the name is hard coded in the ConfigureAmplifyBucket lambda here

  app_id = None
  for app in response["apps"]:
      if app["name"] == "TEAM-IDC-APP":
          app_id = app['appId']
          break