-
Couldn't load subscription status.
- Fork 2.4k
Closed
Description
- Deploy the attached Cloudformation template, see that visiting the API GW address shows the text in the
RandomParameterCF parameter. - Update the stack and change the
RandomParametervalue, see that a new Deployment resource is not created by the Serverless transform and see that visiting the API GW address shows the previous value ofRandomParameterrather than the expected current one.
Thinking about this in the context of my own custom transform I get why detecting the change in the ref is difficult in a transform, with it being a layer removed, but the UX confused me, my VTL changed so why didn't it deploy was my initial reaction.
I suspect this suggestion won't fly but I'm making it anyway: could you generate a new Deployment on every transform regardless of if the Api resource has changed or not? It feels like a safe choice, worst case it's a noop deployment, best case it means !Refs and !Subs and !Ifs within the transformed resource work intuitively.
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Parameters:
RandomParameter:
Type: String
Resources:
Api:
Type: AWS::Serverless::Api
Properties:
StageName: Prod
DefinitionBody:
swagger: '2.0'
schemes:
- https
paths:
"/":
get:
consumes:
- application/json
produces:
- text/html
responses:
'200':
description: Successful operation
headers:
Content-Type:
type: string
x-amazon-apigateway-integration:
responses:
default:
statusCode: '200'
responseParameters:
method.response.header.Content-Type: "'text/html'"
responseTemplates:
text/html: !Sub |-
<html>
<body>
<h1>${RandomParameter}</h1>
</body>
</html>
passthroughBehavior: when_no_match
requestTemplates:
application/json: '{"statusCode": 200}'
type: mock
Outputs:
Url:
Value: !Sub https://${Api}.execute-api.${AWS::Region}.amazonaws.com/Prod
Metadata
Metadata
Assignees
Labels
No labels