Skip to content

Instantly share code, notes, and snippets.

@rainabba
Created March 24, 2021 20:22
Show Gist options
  • Save rainabba/1a824c0cbe2e9de9b9a4b67bbe936bf8 to your computer and use it in GitHub Desktop.
Save rainabba/1a824c0cbe2e9de9b9a4b67bbe936bf8 to your computer and use it in GitHub Desktop.
Where did 'IntelDataApi' come from and why is my deploy failing because of it?
AWSTemplateFormatVersion: 2010-09-09
Transform: 'AWS::Serverless-2016-10-31'
# ... much omitted because it's unrelated
Globals:
Api:
OpenApiVersion: 3.0.1
Auth:
DefaultAuthorizer: NONE # AWS_IAM changed because we can't override on lambdas at this time. See https://github.com/aws/serverless-application-model/issues/984
MethodSettings:
- LoggingLevel: INFO
ResourcePath: '/*' # allows for logging on any resource
HttpMethod: '*' # allows for logging on any method
MinimumCompressionSize: 4096
Function:
Runtime: nodejs12.x
Timeout: 5
Environment:
Variables:
env: !Ref ENV
LOG_LEVEL: !Ref logLevel
LAMBDA_INSIGHTS_LOG_LEVEL: info
Resources:
# Api Gateway
myTestApi:
Type: 'AWS::Serverless::Api'
Properties:
Name: !Sub ${ENV}-my-test-api
Domain:
BasePath: !Ref StageName
DomainName: !Ref CustomDomainName
CertificateArn: !If [ CreateCert, !Ref AutoGeneratedCert, !Ref CertArn ]
Route53:
HostedZoneId: !If [ CreateZone, !Ref HostedZoneId, !Ref ZoneId ]
EvaluateTargetHealth: true
IpV6: true
StageName: !Ref StageName
EndpointConfiguration: REGIONAL
DefinitionBody:
Fn::Transform:
Name: AWS::Include
Parameters:
Location: openapi.yaml
Auth:
UsagePlan:
UsagePlanName: myTestUsagePlan
CreateUsagePlan: SHARED
Description: Public usage plan for ITPS public/no-auth routes
Throttle:
BurstLimit: 1000
RateLimit: 500
Tags:
service: my-test
env: !Sub ${ENV}
Variables:
LOG_LEVEL: "99"
env: !Sub ${ENV}
"ServerlessUsagePlan": {
"Type": "AWS::ApiGateway::UsagePlan",
"Properties": {
"ApiStages": [
{
"ApiId": {
"Ref": "IntelDatApi"
},
"Stage": {
"Ref": "IntelDatApiProdStage"
}
},
{
"ApiId": {
"Ref": "myTestApi"
},
"Stage": {
"Ref": "myTestApiStage"
}
}
],
"UsagePlanName": "myTestUsagePlan",
"Throttle": {
"RateLimit": 500,
"BurstLimit": 1000
},
"Description": "Public usage plan for ITPS public/no-auth routes"
},
"DependsOn": [
"IntelDatApi",
"myTestApi"
]
}
@craigataws
Copy link

any reference to Intel* in the openapi.yaml file?

@rainabba
Copy link
Author

any reference to Intel* in the openapi.yaml file?

Nowhere in my project at all. The issue recurred yesterday with an entirely new resource name and I have seen this multiple times in the past as well. I can try the same deploy multiple times in a row, get the air once, then the next deploy attempt will work perfectly. More recently I decided to seek out help because I was completely locked out and ended up having to delete the stack and redeploy it rather than being able to update it.

@craigataws
Copy link

Can you create an issue in the SAM repo? I think this is best tracked there since CloudFormation calls SAM to do the transformation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment