How to resolve issues with write-only properties in AWS::ApiGateway::RestAPI resources
This topic explains how to resolve issues with write-only properties in AWS::ApiGateway::RestApi resources when using the IaC generator.
Issue
When a generated template contains AWS::ApiGateway::RestApi
resources, then
warnings are generated stating that Body
, BodyS3Location
, and
CloneFrom
properties are identified as UNSUPPORTED_PROPERTIES
.
This is because these are optional write-only properties. The IaC generator doesn't know
whether these properties were ever applied to the resource. Therefore, it omits
these properties in the generated template.
Resolution
To set the Body
property for your REST API, update your generated
template.
-
Use the Amazon API Gateway GetExport API action to download the API. For example, by using the aws apigateway get-export AWS CLI command. For more information, see Export a REST API from API Gateway in the API Gateway Developer Guide.
-
Retrieve the
Body
property from the response of theGetExport
API action. Upload it to an Amazon S3 bucket. -
Download the generated template.
-
Add the
BodyS3Location/Bucket
andBodyS3Location/Key
properties to the template, specifying the bucket name and key where theBody
is stored. -
Open the generated template in the IaC generator console and choose Import edited template.