Skip to content

How do I resolve the "Resource timed out waiting for creation of physical resource" error when I use my resource provider type in CloudFormation to create a resource?

2 minute read
0

When I use my resource provider type to create a resource in AWS CloudFormation, I receive the following error: "Resource timed out waiting for creation of physical resource."

Resolution

When resources don't return their primaryIdentifier or Physical ID within 60 seconds, you receive the "Resource timed out waiting for creation of physical resource" error. This error occurs because the CreateHandler of your resource doesn't return the property that's specified as the primaryIdentifier in the resource type schema file.

Note: The file uses the organization-service-resource.json naming format. For example, article-ec2-subnet.json is the file name for an Amazon Elastic Cloud Compute (Amazon EC2) resource that's named Article::EC2::Subnet.

To resolve the issue, complete the following steps:

  1. In your resource type schema file, confirm that the primaryIdentifier definition uses the following format:
    "primaryIdentifier": [      
           "/properties/Id"
    ]
    Note: Replace Id with the property ID. You can find the resource schema type file in the root directory of your project.
  2. In your CreateHandler file, set the primaryIdentifier property in the model object.
    Example:
    final ResourceModel model = request.getDesiredResourceState();
    model.setId("abcdxyz");
    return ProgressEvent.<ResourceModel, CallbackContext>builder()
        .resourceModel(model)
        .status(OperationStatus.SUCCESS)
        .build();
    Note: Replace Id with the resource's primary identifier and abcdxyz with a unique identifier value for your property.

If you receive a different error when you use your resource provider, then see the following AWS Knowledge Center articles to troubleshoot:

Related information

CloudFormation CLI on the GitHub website.

AWS OFFICIALUpdated a year ago
No comments

Relevant content