The following resource(s) failed to create: [CFNCustomProvider]
Closed this issue · 3 comments
I can't seem to successfully deploy with command aws cloudformation deploy
, or find any resources about the error:
Embedded stack arn:aws:cloudformation:ap-southeast-2:921529881624:stack/name-CustomResourceStack-7DW59NE2GVAK/e7a068f0-198f-11ec-aa73-02f20e17bf6a was not successfully created: The following resource(s) failed to create: [CFNCustomProvider].
Steps to reproduce:
- Host a domain with GoDaddy
- Setup a Route 53 Hosted Zone for the domain (do nothing other than create the Hosted Zone)
- Change the GoDaddy domain's nameservers to the 4 nameservers provided for the Route 53 Zone, and allow sufficient time for changes to propagate
- Follow steps 1-6 Cloning the solution locally from https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/getting-started-secure-static-website-cloudformation-template.html ...
aws s3 mb s3://name-artifacts --region ap-southeast-2
make_bucket: name-artifacts
aws cloudformation package \
--region ap-southeast-2 \
--template-file templates/main.yaml \
--s3-bucket name-artifacts \
--output-template-file packaged.template
aws cloudformation deploy \
--region ap-southeast-2 \
--stack-name name \
--template-file packaged.template \
--capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND \
--parameter-overrides DomainName=mydomain.com SubDomain=www
Expected result:
- The stack deploys
Actual result:
The deployment fails during CREATE_IN_PROGRESS
.
CLI outputs:
Waiting for changeset to be created..
Waiting for stack create/update to complete
Failed to create/update the stack. Run the following command
to fetch the list of events leading up to the failure
aws cloudformation describe-stack-events --stack-name name
aws cloudformation describe-stack-events --stack-name name
:
{
"StackEvents": [
{
"StackId": "arn:aws:cloudformation:ap-southeast-2:921529881624:stack/name/e15255d0-198f-11ec-b726-02a7eba5ab24",
"EventId": "35707430-1990-11ec-8908-0268dfce7816",
"StackName": "name",
"LogicalResourceId": "name",
"PhysicalResourceId": "arn:aws:cloudformation:ap-southeast-2:921529881624:stack/name/e15255d0-198f-11ec-b726-02a7eba5ab24",
"ResourceType": "AWS::CloudFormation::Stack",
"Timestamp": "2021-09-19T21:26:10.406000+00:00",
"ResourceStatus": "ROLLBACK_COMPLETE"
},
{
"StackId": "arn:aws:cloudformation:ap-southeast-2:921529881624:stack/name/e15255d0-198f-11ec-b726-02a7eba5ab24",
"EventId": "CustomResourceStack-DELETE_COMPLETE-2021-09-19T21:26:09.891Z",
"StackName": "name",
"LogicalResourceId": "CustomResourceStack",
"PhysicalResourceId": "arn:aws:cloudformation:ap-southeast-2:921529881624:stack/name-CustomResourceStack-7DW59NE2GVAK/e7a068f0-198f-11ec-aa73-02f20e17bf6a",
"ResourceType": "AWS::CloudFormation::Stack",
"Timestamp": "2021-09-19T21:26:09.891000+00:00",
"ResourceStatus": "DELETE_COMPLETE",
"ResourceProperties": "{\"TemplateURL\":\"https://s3.ap-southeast-2.amazonaws.com/name-artifacts/11b1cecde084b69018f7111349ffd773.template\",\"Tags\":[{\"Value\":\"ACFS3\",\"Key\":\"Solution\"}]}"
},
{
"StackId": "arn:aws:cloudformation:ap-southeast-2:921529881624:stack/name/e15255d0-198f-11ec-b726-02a7eba5ab24",
"EventId": "CustomResourceStack-DELETE_IN_PROGRESS-2021-09-19T21:25:47.897Z",
"StackName": "name",
"LogicalResourceId": "CustomResourceStack",
"PhysicalResourceId": "arn:aws:cloudformation:ap-southeast-2:921529881624:stack/name-CustomResourceStack-7DW59NE2GVAK/e7a068f0-198f-11ec-aa73-02f20e17bf6a",
"ResourceType": "AWS::CloudFormation::Stack",
"Timestamp": "2021-09-19T21:25:47.897000+00:00",
"ResourceStatus": "DELETE_IN_PROGRESS",
"ResourceProperties": "{\"TemplateURL\":\"https://s3.ap-southeast-2.amazonaws.com/name-artifacts/11b1cecde084b69018f7111349ffd773.template\",\"Tags\":[{\"Value\":\"ACFS3\",\"Key\":\"Solution\"}]}"
},
{
"StackId": "arn:aws:cloudformation:ap-southeast-2:921529881624:stack/name/e15255d0-198f-11ec-b726-02a7eba5ab24",
"EventId": "20568990-1990-11ec-9f66-0238336d1d20",
"StackName": "name",
"LogicalResourceId": "name",
"PhysicalResourceId": "arn:aws:cloudformation:ap-southeast-2:921529881624:stack/name/e15255d0-198f-11ec-b726-02a7eba5ab24",
"ResourceType": "AWS::CloudFormation::Stack",
"Timestamp": "2021-09-19T21:25:35.007000+00:00",
"ResourceStatus": "ROLLBACK_IN_PROGRESS",
"ResourceStatusReason": "The following resource(s) failed to create: [CustomResourceStack]. Rollback requested by user."
},
{
"StackId": "arn:aws:cloudformation:ap-southeast-2:921529881624:stack/name/e15255d0-198f-11ec-b726-02a7eba5ab24",
"EventId": "CustomResourceStack-CREATE_FAILED-2021-09-19T21:25:34.317Z",
"StackName": "name",
"LogicalResourceId": "CustomResourceStack",
"PhysicalResourceId": "arn:aws:cloudformation:ap-southeast-2:921529881624:stack/name-CustomResourceStack-7DW59NE2GVAK/e7a068f0-198f-11ec-aa73-02f20e17bf6a",
"ResourceType": "AWS::CloudFormation::Stack",
"Timestamp": "2021-09-19T21:25:34.317000+00:00",
"ResourceStatus": "CREATE_FAILED",
"ResourceStatusReason": "Embedded stack arn:aws:cloudformation:ap-southeast-2:921529881624:stack/name-CustomResourceStack-7DW59NE2GVAK/e7a068f0-198f-11ec-aa73-02f20e17bf6a was not successfully created: The following resource(s) failed to create: [CFNCustomProvider]. ",
"ResourceProperties": "{\"TemplateURL\":\"https://s3.ap-southeast-2.amazonaws.com/name-artifacts/11b1cecde084b69018f7111349ffd773.template\",\"Tags\":[{\"Value\":\"ACFS3\",\"Key\":\"Solution\"}]}"
},
{
"StackId": "arn:aws:cloudformation:ap-southeast-2:921529881624:stack/name/e15255d0-198f-11ec-b726-02a7eba5ab24",
"EventId": "CustomResourceStack-CREATE_IN_PROGRESS-2021-09-19T21:24:00.048Z",
"StackName": "name",
"LogicalResourceId": "CustomResourceStack",
"PhysicalResourceId": "arn:aws:cloudformation:ap-southeast-2:921529881624:stack/name-CustomResourceStack-7DW59NE2GVAK/e7a068f0-198f-11ec-aa73-02f20e17bf6a",
"ResourceType": "AWS::CloudFormation::Stack",
"Timestamp": "2021-09-19T21:24:00.048000+00:00",
"ResourceStatus": "CREATE_IN_PROGRESS",
"ResourceStatusReason": "Resource creation Initiated",
"ResourceProperties": "{\"TemplateURL\":\"https://s3.ap-southeast-2.amazonaws.com/name-artifacts/11b1cecde084b69018f7111349ffd773.template\",\"Tags\":[{\"Value\":\"ACFS3\",\"Key\":\"Solution\"}]}"
},
{
"StackId": "arn:aws:cloudformation:ap-southeast-2:921529881624:stack/name/e15255d0-198f-11ec-b726-02a7eba5ab24",
"EventId": "CustomResourceStack-CREATE_IN_PROGRESS-2021-09-19T21:23:59.151Z",
"StackName": "name",
"LogicalResourceId": "CustomResourceStack",
"PhysicalResourceId": "",
"ResourceType": "AWS::CloudFormation::Stack",
"Timestamp": "2021-09-19T21:23:59.151000+00:00",
"ResourceStatus": "CREATE_IN_PROGRESS",
"ResourceProperties": "{\"TemplateURL\":\"https://s3.ap-southeast-2.amazonaws.com/name-artifacts/11b1cecde084b69018f7111349ffd773.template\",\"Tags\":[{\"Value\":\"ACFS3\",\"Key\":\"Solution\"}]}"
},
{
"StackId": "arn:aws:cloudformation:ap-southeast-2:921529881624:stack/name/e15255d0-198f-11ec-b726-02a7eba5ab24",
"EventId": "e49a06c0-198f-11ec-9bbe-06bff3cf5060",
"StackName": "name",
"LogicalResourceId": "name",
"PhysicalResourceId": "arn:aws:cloudformation:ap-southeast-2:921529881624:stack/name/e15255d0-198f-11ec-b726-02a7eba5ab24",
"ResourceType": "AWS::CloudFormation::Stack",
"Timestamp": "2021-09-19T21:23:54.779000+00:00",
"ResourceStatus": "CREATE_IN_PROGRESS",
"ResourceStatusReason": "User Initiated"
},
{
"StackId": "arn:aws:cloudformation:ap-southeast-2:921529881624:stack/name/e15255d0-198f-11ec-b726-02a7eba5ab24",
"EventId": "e151b990-198f-11ec-b726-02a7eba5ab24",
"StackName": "name",
"LogicalResourceId": "name",
"PhysicalResourceId": "arn:aws:cloudformation:ap-southeast-2:921529881624:stack/name/e15255d0-198f-11ec-b726-02a7eba5ab24",
"ResourceType": "AWS::CloudFormation::Stack",
"Timestamp": "2021-09-19T21:23:49.376000+00:00",
"ResourceStatus": "REVIEW_IN_PROGRESS",
"ResourceStatusReason": "User Initiated"
}
]
}
Hi Jackson, thanks for raising an issue, and including useful detail.
If you check the events in the embedded stack arn:aws:cloudformation:ap-southeast-2:921529881624:stack/name/e15255d0-198f-11ec-b726-02a7eba5ab24
, is there a more descriptive reason for theCFNCustomProvider
failing?
If there isn't more detail, an alternative place to check is the logs for the lambda function acting as the custom resource CFNCustomProvider
. These can be found in the the Cloudwatch logs group for that lambda function.
Not sure if it's for the exact same reason, but here is an error occuring in the embedded stack :
Resource handler returned message: "Error occurred while GetObject. S3 Error Code: PermanentRedirect. S3 Error Message: The bucket is in this region: us-east-1. Please use this region to retry the request (Service: Lambda, Status Code: 400, Request ID: 61242b39-ccfb-4eec-be99-2f5b73701416, Extended Request ID: null)" (RequestToken: 5f8b59fa-1632-2d4c-7fa1-1477df191d35, HandlerErrorCode: InvalidRequest)