Comments (5)
Hi @yan-olydis, thanks for reporting the issue. Could you share your template file? SAM CLI does not cover resolving all the intrinsic functions and from the traceback, this might be throwing an error because of that.
from aws-sam-cli.
this is my template
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
General parameters
EnvType:
Description: Environment Type
Type: String
AllowedValues:
- development
- staging
- production
DBInstanceClass:
Description: Instance class
Type: String
isEnableDeletionProtection:
Description: Enable Deletion Protection
Type: String
Default: false
AllowedValues:
- true
- false
isEnableBackup:
Description: Enable DocumentDB Backup
Type: String
Default: false
AllowedValues:
- true
- false
Conditions:
isProduction: !Equals [ !Ref EnvType, "production" ]
isDev: !Equals [ !Ref EnvType, "development" ]
Mappings:
Network:
development:
NbAzs: 3
CidrBlockPrefix: 10.1
CidrBlock: 10.1.0.0/16
staging:
NbAzs: 3
CidrBlockPrefix: 10.2
CidrBlock: 10.2.0.0/16
production:
NbAzs: 3
CidrBlockPrefix: 10.3
CidrBlock: 10.3.0.0/16
Resources:
Network:
Type: AWS::CloudFormation::Stack
Properties:
StackName: my-vpc
TemplateURL: 'network/vpc.yml'
Parameters:
EnvType: !Ref EnvType
RegionAzs: !FindInMap [Network, !Ref EnvType, NbAzs]
CidrBlockPrefix: !FindInMap [Network, !Ref EnvType, CidrBlockPrefix]
EcsCluster:
Type: AWS::CloudFormation::Stack
Properties:
StackName: my-ecs
TemplateURL: 'ecs/ecs.yml'
Parameters:
EnvType: !Ref EnvType
VpcId: !GetAtt Network.Outputs.VpcId
CidrBlockPrefix: !FindInMap [Network, !Ref EnvType, CidrBlockPrefix]
LoadBalancing:
Type: AWS::CloudFormation::Stack
Properties:
StackName: my-nlb
TemplateURL: 'nlb/nlb.yml'
Parameters:
VpcId: !GetAtt Network.Outputs.VpcId
PrivateSubnets: !GetAtt Network.Outputs.PrivateSubnets
PrivateHostedZoneId: !GetAtt Network.Outputs.PrivateHostedZoneId
DocumentDB:
Type: AWS::CloudFormation::Stack
DependsOn:
- Encryption
Properties:
StackName: my-database
TemplateURL: 'db/db.yml'
Parameters:
EnvType: !Ref EnvType
PrivateSubnets: !GetAtt Network.Outputs.PrivateSubnets
AvailabilityZones: !GetAtt Network.Outputs.AvailabilityZones
EncryptionKeyId: !GetAtt Encryption.Outputs.EncryptionKeyId
DBInstanceClass: !Ref DBInstanceClass
isEnableDeletionProtection: !Ref isEnableDeletionProtection
isEnableBackup: !Ref isEnableBackup
VpcId: !GetAtt Network.Outputs.VpcId
Encryption:
Type: AWS::CloudFormation::Stack
Properties:
StackName: my-encryption-key
TemplateURL: encryption/encryption.yml
Parameters:
EnvType: !Ref EnvType
from aws-sam-cli.
Thanks for providing the template file. I tried running sam build
on the below template, but the command succeeds for me. I don't see any lambda/serverless functions in the template you provided as well. Would you be able to provide the nested stack templates? My guess is there is some intrinsic function in that template which SAM CLI does not support.
template.yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
sam-app-6787
Sample SAM Template for sam-app-6787
Parameters:
EnvType:
Description: Environment Type
Type: String
AllowedValues:
- development
- staging
- production
DBInstanceClass:
Description: Instance class
Type: String
isEnableDeletionProtection:
Description: Enable Deletion Protection
Type: String
Default: false
AllowedValues:
- true
- false
isEnableBackup:
Description: Enable DocumentDB Backup
Type: String
Default: false
AllowedValues:
- true
- false
Conditions:
isProduction: !Equals [ !Ref EnvType, "production" ]
isDev: !Equals [ !Ref EnvType, "development" ]
Mappings:
Network:
development:
NbAzs: 3
CidrBlockPrefix: 10.1
CidrBlock: 10.1.0.0/16
staging:
NbAzs: 3
CidrBlockPrefix: 10.2
CidrBlock: 10.2.0.0/16
production:
NbAzs: 3
CidrBlockPrefix: 10.3
CidrBlock: 10.3.0.0/16
Resources:
Network:
Type: AWS::CloudFormation::Stack
Properties:
StackName: my-vpc
TemplateURL: 'nested-template.yaml'
Parameters:
EnvType: !Ref EnvType
RegionAzs: !FindInMap [Network, !Ref EnvType, NbAzs]
CidrBlockPrefix: !FindInMap [Network, !Ref EnvType, CidrBlockPrefix]
EcsCluster:
Type: AWS::CloudFormation::Stack
Properties:
StackName: my-ecs
TemplateURL: 'nested-template.yaml'
Parameters:
EnvType: !Ref EnvType
VpcId: !GetAtt Network.Outputs.VpcId
CidrBlockPrefix: !FindInMap [Network, !Ref EnvType, CidrBlockPrefix]
LoadBalancing:
Type: AWS::CloudFormation::Stack
Properties:
StackName: my-nlb
TemplateURL: 'nested-template.yaml'
Parameters:
VpcId: !GetAtt Network.Outputs.VpcId
PrivateSubnets: !GetAtt Network.Outputs.PrivateSubnets
PrivateHostedZoneId: !GetAtt Network.Outputs.PrivateHostedZoneId
DocumentDB:
Type: AWS::CloudFormation::Stack
DependsOn:
- Encryption
Properties:
StackName: my-database
TemplateURL: 'nested-template.yaml'
Parameters:
EnvType: !Ref EnvType
PrivateSubnets: !GetAtt Network.Outputs.PrivateSubnets
AvailabilityZones: !GetAtt Network.Outputs.AvailabilityZones
EncryptionKeyId: !GetAtt Encryption.Outputs.EncryptionKeyId
DBInstanceClass: !Ref DBInstanceClass
isEnableDeletionProtection: !Ref isEnableDeletionProtection
isEnableBackup: !Ref isEnableBackup
VpcId: !GetAtt Network.Outputs.VpcId
Encryption:
Type: AWS::CloudFormation::Stack
Properties:
StackName: my-encryption-key
TemplateURL: 'nested-template.yaml'
Parameters:
EnvType: !Ref EnvType
from aws-sam-cli.
Closing due to inactivity.
from aws-sam-cli.
⚠️ COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
from aws-sam-cli.
Related Issues (20)
- SAM build crashes using terraform HOT 9
- Bug: sam local start-api - AttributeError HOT 9
- SAM local invocation with CDK generated template with typescript not able to find module index (index.mjs) HOT 5
- How to add tags with sam deploy HOT 12
- Bug: Got issue when using 1.116.0_1 for deployment HOT 2
- Bug: [WinError 3] The system cannot find the path specified HOT 4
- Feature request: Deploy Lambdas with concurrency HOT 3
- Bug: sam sync with python causes endless cpu saturation HOT 11
- Bug: sam build - EmptyKeyError HOT 1
- Bug: Unable to run sam local invoke on Apple Silicon HOT 14
- Cannot sam local start-api without specifying an image HOT 1
- Bug: sam local start-api - ReadTimeout HOT 3
- Bug: "Timed out while attempting to establish a connection to the container" error after fresh install of Docker and AWS SAM HOT 7
- Bug: sam build - JSONDecodeError HOT 3
- Bug: No new Lambda Versions are deployed with Lambda configurations changes HOT 2
- Bug: Change Parameter's Default value doesn't reflect HOT 6
- Bug: AWS ADOT LAMBDA layer stuck when using local invoke HOT 5
- Bug: AWS::Serverless::Function `ImageUri` with map (ex: using `!Sub`) fails with type error HOT 7
- Bug: Lambda function (with alias) doesn't create a new version after its layer is updated, even if `AutoPublishAliasAllProperties` is set to `true`
- Access to internal enterprise host (Github entreprise) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-sam-cli.