How do I resolve the "Attribute 'Key' does not exist" error when I use the Fn::GetAtt function on my resource provider resource in CloudFormation?

2 minute read

When I use the Fn::GetAtt function on my resource provider in AWS CloudFormation, I receive the following error: "Attribute 'Key' does not exist"

Short description

CloudFormation returns the "Attribute 'Key' does not exist" error because it isn't receiving the required property. The ReadHandler of your resource must return a property that's specified from the readOnlyProperties list in the organization-service-resource.json resource provider schema file.

For other errors that are related to using a resource provider, see the following articles:


1.    In your organization-service-resource.json file, confirm that the readOnlyProperties definition uses the following format, where Output is a property that's defined in the properties section. For example:

"readOnlyProperties": [

Note: The organization-service-resource.json format is located in the root directory of your project.

2.    In your ReadHandler, set the property in the model object. For example:

final ResourceModel model = request.getDesiredResourceState();
return ProgressEvent.<ResourceModel, CallbackContext>builder()

Related information

AWS CloudFormation CLI (from the GitHub website)

AWS OFFICIALUpdated 2 years ago