aws-samples / aws-cdk-amplify-with-waf

enable WAF for Amplify Hosted web applications
MIT No Attribution
30 stars 18 forks source link

"rAmplifyAppBranchUpdate" cannot find Amplify application #1

Open HaeyoonJo opened 1 year ago

HaeyoonJo commented 1 year ago

I specified web_acl_arn, app_id and branch_name according to README and then had deployed "CustomAmplifyDistributionStack" using cdk deploy after all of steps.

See cdk.json I modified below

  "context": {
    "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": true,
    ...
    "web_acl_arn":"arn:aws:wafv2:us-east-1:00000000:global/webacl/xxxxxxxxxx/xxxxxxxxxx",
    "app_id":"d3xxxxxxxxxx",
    "branch_name":"main"
  }

During provisioning my stack, it has prompted error message that can't find the Amplify app.

[█████████████████████▍····································] (10/27)

3:28:30 PM | CREATE_FAILED        | Custom::AWS                         | rAmplifyAppBranchUpdate/Resource/Default
Received response status [FAILED] from custom resource. Message returned: App d3xxxxxxxxxx not found. (RequestId: d38ac0a9-a988-4fb3-9e65
-f84b04ea61ce)
[██████▍···················································] (3/27)

3:28:30 PM | CREATE_FAILED        | Custom::AWS                         | rAmplifyAppBranchUpdate/Resource/Default
Received response status [FAILED] from custom resource. Message returned: App d3xxxxxxxxxx not found. (RequestId: d38ac0a9-a988-4fb3-9e65-
f84b04ea61ce)
3:28:38 PM | ROLLBACK_IN_PROGRESS | AWS::CloudFormation::Stack          | CustomAmplifyDistributionStack
The following resource(s) failed to create: [rAmplifyAppBranchUpdate54EFE0C4, rCustomCloudFrontDistribution1C2C48D3]. Rollback requested by
user.

I've verified the branch_name and app_id whether it's correct. Im not sure this is related to rAmplifyAppBranchUpdate CDK name in the amplify_add_on_stack.py file as linked to https://github.com/aws-samples/aws-cdk-amplify-with-waf/blob/c057650ac3556a88f5f20962807e888399529997/src/amplify_add_on_stack.py#L108.

awskaran commented 1 year ago

@HaeyoonJo can you confirm that the account and region in which you are attempting to deploy the cdk app is the same account and region in which the Amplify App is available ?

axzelmarin commented 1 year ago

Hey I'm having the same problem trying to deploy today, I can confirm that us-region-2 is where I host the amplify app

HaeyoonJo commented 1 year ago

@awskaran yes, I confirmed the cdk app were in the same account and region where the Amplify app is available.