Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
npm init -ynpm install -D takomo npx tkm --versionnpm install -g takomotkm --version[takomo-quick-start]
aws_access_key_id = ENTER_YOUR_ACCESS_KEY_ID_HERE
aws_secret_access_key = ENTER_YOUR_SECRET_ACCESS_KEY_HEREmkdir takomo-quick-startcd takomo-quick-start
npm init -ynpm install -D takomo npx tkm init --create-samples --project quick-start --regions eu-west-1npx tkm stacks deploy --profile takomo-quick-startnpx tkm stacks undeploy --profile takomo-quick-startHome dir is {{ env.HOME }}terminationProtection: truearn:aws:iam::123456789012:role/deployer-roleaccountIds: "123456789012"obsolete: trueregions: eu-west-1regions:
- eu-central-1
- eu-north-1
- us-east-1Resources:
Bucket:
Type: AWS::S3::Bucket
Properties:
Tags:
- Key: Environment
Value: {{ stack.data.environment.name }}
- Key: Code
Value: {{ stack.data.environment.code }}accountIds:
- "876272828282"
- "763273627326"templateBucket:
name: my-bucket
keyPrefix: template-files/templateBucket:
name: hello-bucket{{ variable_name }}{{ person.firstName }}{{ people.[0] }}{{! This comment will not show up in the output}}{{!-- This comment may contain mustaches like }} --}}{{#if some_variable}}
this will be included in the output
{{/if}}{{#each securityGroupIds}}
- {{this}}
{{/each}}capabilities: CAPABILITY_IAMcapabilities:
- CAPABILITY_IAM
- CAPABILITY_NAMED_IAMname: vpctkm stacks inspect configuration [command-path] \
[--interactive|-i] \
[--output <format>]project property is specified, prepend it to the namedynamic--output <format>timeout: 180tkm stacks deploy --log trace[my-profile]
aws_access_key_id=<YOUR ACCESS KEY ID>
aws_secret_access_key=<YOUR SECRET ACCESS KEY>AWS_PROFILE=my-profile tkm stacks deploytkm stacks deploy --profile my-profile[manager]
aws_access_key_id=<YOUR ACCESS KEY ID>
aws_secret_access_key=<YOUR SECRET ACCESS KEY>
[account-a-admin]
role_arn=arn:aws:iam::123456789012:role/admin
source_profile=manager
[account-b-readonly]
role_arn=arn:aws:iam::210987654321:role/readonly
source_profile=managertkm stacks deploy --profile account-a-admin[manager]
aws_access_key_id=<YOUR ACCESS KEY ID>
aws_secret_access_key=<YOUR SECRET ACCESS KEY>
[account-a-admin]
role_arn=arn:aws:iam::123456789012:role/admin
source_profile=manager
mfa_serial=arn:aws:iam::224466880011:mfa/usernametkm stacks deploy --profile account-admincapabilities: []tkm stacks inspect configurationtkm stacks inspect configuration /prodtimeout:
create: 300timeout:
create: 300
update: 120tkm <your command here> --statsschemas:
data: myDataSchema
tags:
- commonTags
- name: environmentTag
allowedValues:
- dev
- test
- prodschemas/data.js
module.exports = {
name: "myDataSchema",
init: ({ joi }) => joi.object({
owner: joi.string().email(),
costCenter: joi.number().required()
})
}module.exports = {
name: "commonTags",
init: ({ joi }) => joi.object({
project: joi.string().required()
})
}module.exports = {
name: "environmentTag",
init: ({ joi, props }) => {
return joi.object({
environment: joi.string().valid(...props.allowedValues)
})
}
}stackPolicy: |
{
"Statement": [
{
"Effect": "Allow",
"NotAction": "Update:Delete",
"Principal": "*",
"Resource": "*"
}
]
}stackPolicy:
Statement:
- Effect: Allow
NotAction: Update:Delete
Principal: "*"
Resource: "*"stackPolicyDuringUpdate:
Statement:
- Effect: Allow
Action: Update:*
Principal: "*"
Resource: "*"{
"Statement": [
{
"Effect": "Allow",
"Action": "Update:*",
"Principal": "*",
"Resource": "*"
}
]
}tkm stacks detect-drift [command-path]Statement:
- Sid: Stacks
Effect: Allow
Action:
- cloudformation:DescribeStacks
- cloudformation:DetectStackDrift
- cloudformation:DescribeStackDriftDetectionStatus
Resource: "*"
# IAM permissions needed only if command roles are used
# Specify resource to restrict access to specific roles.
- Sid: IAM
Effect: Allow
Action:
- sts:AssumeRole
Resource: "*" tkm stacks detect-drifttkm stacks detect-drift /prodtkm stacks list [command-path] [--output <format>]Statement:
- Sid: Stacks
Effect: Allow
Action: cloudformation:DescribeStacks
Resource: "*"
# IAM permissions needed only if command roles are used.
# Specify Resource to restrict access to specific roles.
- Sid: IAM
Effect: Allow
Action: sts:AssumeRole
Resource: "*" tkm stacks listtkm stacks list /prodtkm stacks inspect dependency-graph [command-path]tkm stacks inspect dependency-graphtkm stacks inspect dependency-graph /prod.
ββ stacks
ββ templates
ββ helpers
ββ partials
ββ resolvers
ββ hooks
ββ schemas
ββ deployment
ββ config-sets
ββ organizationparameters:
CommitHash:
resolver: file-contents
file: /tmp/commit.txtparameters:
Code:
resolver: file-contents
file: code.txtparameters:
Greeting:
resolver: hook-output
hook: my-hook
hooks:
- name: my-hook
type: cmd
stage: before
command: echo 'hello world'module.exports = {
type: "first",
init: (props) => {
return {
execute: (input) => {
return {
message: "OK",
success: true,
value: "My greeting to the next hook"
}
}
}
}
}template: my-stack.yml
regions: eu-west-1
hooks:
- name: firstHook
type: first
- name: secondHook
type: second parameters:
VpcId: vpc-06e4ab6c6cparameters:
CidrBlocks:
- 10.0.0.0/26
- 10.0.0.64/26parameters:
VpcId:
value: vpc-06e4ab6c6cparameters:
VpcId:
value: vpc-06e4ab6c6c
immutable: trueparameters:
VpcId:
resolver: stack-output
stack: /vpc.yml
output: vpcIdparameters:
VpcId:
resolver: external-stack-output
stack: vpc-stack
output: vpcId
region: eu-west-1
commandRole: arn:aws:iam::123456789012:role/deployerparameters:
Password:
resolver: ssm
name: /database/passwordparameters:
Username:
resolver: ssm
region: eu-north-1
name: /database/usernameparameters:
Password:
resolver: ssm
commandRole: arn:aws:iam::123456789012:role/read-only
name: MyParam.
ββ stacks
β ββ vpc.yml
β ββ security-groups.yml
ββ templates
ββ vpc.yml
ββ security-groups.ymlparameters:
VpcId:
resolver: stack-output
stack: /vpc.yml
output: MyVpcIdmodule.exports = {
type: "second",
init: (props) => {
return {
execute: (input) => {
const greeting = input.variables.hooks.firstHook
// Do something with the greeting here...
return true
}
}
}
}.
ββ stacks
β ββ application.yml
ββ templates
ββ application-template.ymltemplate: application-template.ymltemplate:
inline: |
Resources:
VPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.0.0.0/16
template:
filename: networking.yml
dynamic: false--var myVariable=helloResources:
LogGroup:
Type: AWS::Logs::LogGroup
LogGroupName: {{ var.myVariable }}--var-file commitHash=commit.txtname: James
age: 55
permissions:
- create
- delete
- update--var-file person=/home/variables.ymlparameters:
UserName: {{ var.person.name }}
UserAge: {{ var.person.age }}{
"color: "red",
"foo": {
"bar": true
}
}--var-file person=/home/variables.ymlparameters:
Color: {{ var.color }}
FooBarEnabled: {{ var.foo.bar }}{
"color": "blue",
"width": 100,
"settings": {
"debug": true
}
}{
"settings": {
"debug": false
}
}--var-file base.json \
--var-file prod.json \
--var color=yellow \
--var height=200{
"color": "yellow",
"width": 100,
"height": 200,
"settings": {
"debug": false
}
}.
ββ stacks
β ββ config.yml
β ββ dev
β β ββ config.yml
β β ββ application.yml
β β ββ vpc.yml
β ββ prod
β ββ application.yml
β ββ vpc.yml
ββ templates
ββ application-template.yml
ββ vpc-template.ymlparameters:
Password:
resolver: cmd
command: cat /home/password.txttkm stacks undeploy [command-path] \
[--ignore-dependencies] \
[--interactive|-i] \
[--output <format>]# Minimum permissions. Additional permissions are needed to actually
# remove the resources defined in CloudFormation templates.
Statement:
- Sid: Stacks
Effect: Allow
Action:
- cloudformation:DescribeStackEvents
- cloudformation:DeleteStack
- cloudformation:DescribeStacks
Resource: "*"
# IAM permissions needed only if command roles are used
# Specify resource to restrict access to specific roles.
- Sid: IAM
Effect: Allow
Action:
- sts:AssumeRole
Resource: "*" tkm stacks undeploytkm stacks undeploy /devtkm stacks undeploy /dev/vpc.ymltkm stacks undeploy /dev/vpc.yml/eu-west-1tkm stacks undeploy /cloudtrail.yml --ignore-dependenciesparameters:
Password:
resolver: secret
secretId: my-secret-passwordparameters:
MyParam:
resolver: secret
secretId: my-secret-password
region: eu-west-1parameters:
MyParam:
resolver: secret
secretId: arn:aws:secretsmanager:us-west-2:123456789012:secret:MySecret
commandRole: arn:aws:iam::123456789012:role/SecretReaderrequiredVersion: ">=3.4.0"regions:
- us-east-1
- eu-west-1
- eu-central-1
- eu-north-1 features:
deploymentTargetsUndeploy: falseextends: ../my-parent-config.ymltkm stacks prune [command-path] \
[--ignore-dependencies] \
[--interactive|-i] \
[--output <format>]yamldepends: /dev/vpc.ymlDB_HOST=localhost
DB_USER=root
DB_PASS=s1mpl3hooks:
- name: executed-after-successful-create
type: cmd
operation: create
stage: after
status: success
command: echo 'success'hooks:
- name: my-hook
type: cmd
operation:
- create
- update
stage: after
command: echo 'hello'# Minimum permissions. Additional permissions are needed to actually
# remove the resources defined in CloudFormation templates.
Statement:
- Sid: Stacks
Effect: Allow
Action:
- cloudformation:DescribeStackEvents
- cloudformation:DeleteStack
- cloudformation:DescribeStacks
Resource: "*"
# IAM permissions needed only if command roles are used
# Specify resource to restrict access to specific roles.
- Sid: IAM
Effect: Allow
Action:
- sts:AssumeRole
Resource: "*" tkm stacks prunetkm stacks prune /devtkm stacks prune /dev/vpc.ymltkm stacks prune /dev/vpc.yml/eu-west-1tkm stacks prune /cloudtrail.yml --ignore-dependenciesdepends: /dev/vpc.yml/eu-west-1depends:
- /dev/vpc.yml
- /dev/security-groups.ymldepends: ../../common/logs.ymlmodule.exports = {
name: "my-tags",
init: ({ joi }) => joi.object({
environment: joi.string().valid("dev", "test", "prod").required(),
costCenter: joi.number().required()
}).unknown(false)
} schemas:
tags: my-tags
tags:
environment: dev
costCenter: 1234 tkm iam generate-policies \
--start-time <start-time> \
--end-time <end-time> \
--identity <identity>... \
--region <region>... \
[--role-name <role-name>]
Statement:
- Sid: CloudTrail
Effect: Allow
Action: cloudtrail:LookupEvents
Resource: "*"
# IAM permissions needed only if policies are generated
# from multiple accounts. Specify the Resource to restrict
# access to specific roles.
- Sid: IAM
Effect: Allow
Action: sts:AssumeRole
Resource: "*" tkm iam generate-policies \
--start-time 2021-05-02T16:45:54.169Z \
--end-time 2021-05-02T16:45:54.462Z \
--identity arn:aws:iam::123456789012:user/[email protected] \
--region eu-west-1 \
--region us-east-1tkm stacks deploy [command-path] \
[--ignore-dependencies] \
[--interactive|-i] \
[--expect-no-changes] \
[--output <format>]props.
ββ stacks
β ββ build-infra.yml
ββ templates
ββ build-infra.ymlregions: us-east-1
parameters:
SrcBucket:
resolver: external-stack-output
stack: src-bucket
output: SrcBucketName
commandRole: arn:aws:iam::123456789012:role/read-only
AssetsBucket:
resolver: external-stack-output
stack: assets-bucket
output: AssetsBucketName
region: eu-west-1# Minimum permissions. Additional permissions are needed to actually
# modify resources defined in the CloudFormation templates.
Statement:
- Sid: CloudFormation
Effect: Allow
Action:
- cloudformation:CancelUpdateStack
- cloudformation:DescribeStackEvents
- cloudformation:CreateStack
- cloudformation:GetTemplate
- cloudformation:DeleteStack
- cloudformation:UpdateStack
- cloudformation:CreateChangeSet
- cloudformation:DescribeChangeSet
- cloudformation:DeleteChangeSet
- cloudformation:ValidateTemplate
- cloudformation:DescribeStacks
- cloudformation:GetTemplateSummary
- cloudformation:UpdateTerminationProtection
Resource: "*"
# S3 permissions needed only if a template bucket is used.
# Specify resource to restrict access to specific buckets.
- Sid: S3
Effect: Allow
Action:
- s3:PutObject
Resource: "*"
# IAM permissions needed only if command roles are used
# Specify resource to restrict access to specific roles.
- Sid: IAM
Effect: Allow
Action:
- sts:AssumeRole
Resource: "*"tkm stacks deploytkm stacks deploy /prodtkm stacks deploy /dev/vpc.ymltkm stacks deploy /dev/vpc.yml/eu-west-1tkm stacks deploy /cloudtrail.yml --ignore-dependencies.
ββ stacks
β ββ my-stack.yml
ββ hooks
β ββ debug.js
ββ templates
ββ my-stack.ymlmodule.exports = {
type: "debug",
init: (props) => {
console.log("Initialize debug hook")
return {
execute: (input) => {
console.log("Execute debug hook!")
console.log(`Stage: ${input.stage}`)
console.log(`Operation: ${input.operation}`)
console.log(`Status: ${input.status}`)
console.log(JSON.stringify(props, null, 2))
return {
message: "OK",
success: true,
value: "Did some debugging"
}
}
}
}
}hooks:
- name: my-hook
type: debug- name: my-hook
type: cmd
command: echo 'hello world'- name: my-another-hook
type: cmd
exposeStackCredentials: true
command: aws sts get-caller-identity- name: my-checksum
type: checksum
dir: lambda/scripts- name: my-hex-checksum
type: checksum
dir: lambda/scripts
encoding: hex.
ββ stacks
β ββ my-stack.yml
ββ resolvers
β ββ uppercase.js
ββ templates
ββ my-stack.ymlmodule.exports = {
name: "uppercase",
schema: ({joi, base}) => {
return base.keys({
value: joi.string().max(50).required()
})
},
init: (props) => {
return {
confidential: true,
dependencies: () => [],
iamRoleArns: [],
resolve: (input) => {
input.logger.debug("Execute uppercase!");
input.logger.debug(`Resolve value for parameter '${input.parameterName}'`);
return props.value.toUpperCase();
}
}
}
}parameters:
MyParameter:
resolver: uppercase
value: hello.
ββ index.js
ββ package.jsonmodule.exports = {
name: "timestamp",
init: () => Date.now(),
}{
"name": "takomo-timestamp-resolver",
"version": "0.0.1",
"description": "My custom timestamp resolver",
"files": [
"index.js"
],
"main": "index.js",
"license": "MIT",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}npm install [email protected] --save-dev # Add resolvers section
resolvers:
# 1) Use just the package name
- takomo-timestamp-resolver
# 2) Give the package name with 'package' property
- package: takomo-timestamp-resolver
# 3) Give the package name with 'package' property and
# override the resolver name with 'name' property.
- package: takomo-timestamp-resolver
name: special-timestampparameters:
DatabasePassword:
resolver: secret
secretId: my-password-secretextends: ../takomo.parent.ymltkm org accounts list-stacks --config-set-type standardtkm org accounts list-stacks ROOT/Workload --config-set-type standardtkm org accounts list-stacks \
-a 123456789012 210987654321 \
--config-set-type standardconst execute = (input) => {
// Some logic that determines if the stack operations should be skipped
const skipIsNeeded = isSkipNeeded()
return {
skip: skipIsNeeded,
success: true,
}
}
// Hook provider that initializes the hook
module.exports = {
type: "example",
init: (props) => ({ execute })
}[takomo-tutorial]
aws_access_key_id = ENTER_YOUR_ACCESS_KEY_ID_HERE
aws_secret_access_key = ENTER_YOUR_SECRET_ACCESS_KEY_HEREmkdir takomo-tutorialcd takomo-tutorial
npm init -ynpm install -D takomo mkdir stacks
mkdir templatesmkdir -p stacks/dev/eu-west-1
mkdir -p stacks/prod/eu-west-1.
ββ stacks
β ββ dev
β β ββ eu-west-1
β ββ prod
β ββ eu-west-1
ββ templates
ββ package.jsontouch templates/dynamodb.ymlParameters:
Environment:
Type: String
Description: Application environment
AllowedValues:
- dev
- prod
Resources:
Table:
Type: AWS::DynamoDB::Table
Properties:
TableName: !Sub my-table-${Environment}
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
Outputs:
TableName:
Value: !Ref Table
TableArn:
Value: !GetAtt Table.Arn touch stacks/dev/eu-west-1/dynamodb.ymlregions: eu-west-1
template: dynamodb.yml
parameters:
Environment: dev.
ββ stacks
β ββ dev
β β ββ eu-west-1
β β ββ dynamodb.yml
β ββ prod
β ββ eu-west-1
ββ templates
β ββ dynamodb.yml
ββ package.jsonnpx tkm stacks deploy --profile takomo-tutorialtouch templates/vpc.ymlParameters:
Environment:
Type: String
Description: Application environment
AllowedValues:
- dev
- prod
VpcCidr:
Type: String
Description: VPC CIDR block
Resources:
Vpc:
Type: AWS::EC2::VPC
Properties:
CidrBlock: !Ref VpcCidr
Subnet:
Type: AWS::EC2::Subnet
Properties:
CidrBlock: !Ref VpcCidr
VpcId: !Ref Vpc
RouteTable:
Type: AWS::EC2::RouteTable
Properties:
VpcId: !Ref Vpc
RouteTableAssociation:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
SubnetId: !Ref Subnet
RouteTableId: !Ref RouteTable
Outputs:
VpcId:
Value: !Ref Vpc
RouteTableIds:
Value: !Ref RouteTable
SubnetIds:
Value: !Ref Subnet
touch stacks/dev/eu-west-1/vpc.ymlregions: eu-west-1
template: vpc.yml
parameters:
Environment: dev
VpcCidr: 10.0.0.0/26.
ββ stacks
β ββ dev
β β ββ eu-west-1
β β ββ dynamodb.yml
β β ββ vpc.yml
β ββ prod
β ββ eu-west-1
ββ templates
β ββ dynamodb.yml
β ββ vpc.yml
ββ package.jsonnpx tkm stacks list --profile takomo-tutorialnpx tkm stacks deploy --profile takomo-tutorialtouch stacks/dev/config.ymldata:
environment: devtouch stacks/dev/eu-west-1/config.ymlregions: eu-west-1template: dynamodb.yml
parameters:
Environment: {{ stackGroup.data.environment }}template: vpc.yml
parameters:
Environment: {{ stackGroup.data.environment }}
VpcCidr: 10.0.0.0/26.
ββ stacks
β ββ dev
β β ββ config.yml
β β ββ eu-west-1
β β ββ config.yml
β β ββ dynamodb.yml
β β ββ vpc.yml
β ββ prod
β ββ eu-west-1
ββ templates
β ββ dynamodb.yml
β ββ vpc.yml
ββ package.jsonnpx tkm stacks deploy --profile takomo-tutorialtouch templates/vpc-endpoints.ymlParameters:
Environment:
Type: String
Description: Application environment
AllowedValues:
- dev
- prod
VpcId:
Type: AWS::EC2::VPC::Id
Description: Id of the VPC where the endpoints should be created
RouteTableIds:
Type: CommaDelimitedList
Description: Ids of the route tables where the endpoints should be attached
Resources:
DynamoDbVpcEndpoint:
Type: AWS::EC2::VPCEndpoint
Properties:
RouteTableIds: !Ref RouteTableIds
ServiceName: !Sub com.amazonaws.${AWS::Region}.dynamodb
VpcEndpointType: Gateway
VpcId: !Ref VpcIdtouch stacks/dev/eu-west-1/vpc-endpoints.ymltemplate: vpc-endpoints.yml
parameters:
Environment: {{ stackGroup.data.environment }}
VpcId:
resolver: stack-output
stack: vpc.yml
output: VpcId
RouteTableIds:
resolver: stack-output
stack: vpc.yml
output: RouteTableIds.
ββ stacks
β ββ dev
β β ββ config.yml
β β ββ eu-west-1
β β ββ config.yml
β β ββ dynamodb.yml
β β ββ vpc.yml
β β ββ vpc-endpoints.yml
β ββ prod
β ββ eu-west-1
ββ templates
β ββ dynamodb.yml
β ββ vpc.yml
β ββ vpc-endpoints.yml
ββ package.jsonnpx tkm stacks deploy \
/dev/eu-west-1/vpc-endpoints.yml \
--profile takomo-tutorialmkdir partials
touch partials/lambda.jsconst AWS = require("aws-sdk")
const dynamo = new AWS.DynamoDB.DocumentClient()
exports.handler = async (event, context) => {
console.log("EVENT: \n" + JSON.stringify(event, null, 2))
await dynamo.put({
TableName: process.env.TABLE_NAME,
Item: {
id: Date.now().toString()
}
}).promise()
const { Count } = await dynamo.scan({ TableName: process.env.TABLE_NAME }).promise()
return Count
}touch templates/lambda.ymlParameters:
Environment:
Type: String
Description: Application environment
AllowedValues:
- dev
- prod
VpcId:
Type: AWS::EC2::VPC::Id
Description: Id of the VPC where the endpoints should be created
SubnetIds:
Type: CommaDelimitedList
Description: Ids of the subnets where the function should be created
TableName:
Type: String
Description: Name of the DynamoDB table
TableArn:
Type: String
Description: ARN of the DynamoDB table
Resources:
FunctionSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: !Sub tutorial-function-${Environment}
VpcId: !Ref VpcId
FunctionRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Service: lambda.amazonaws.com
Action: sts:AssumeRole
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole
Policies:
- PolicyName: DynamoDB
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action:
- dynamodb:PutItem
- dynamodb:Scan
Resource: !Ref TableArn
Function:
Type: AWS::Lambda::Function
Properties:
FunctionName: !Sub tutorial-function-${Environment}
Handler: index.handler
MemorySize: 128
Role: !GetAtt FunctionRole.Arn
Runtime: nodejs12.x
Timeout: 10
Environment:
Variables:
TABLE_NAME: !Ref TableName
VpcConfig:
SecurityGroupIds:
- !Ref FunctionSecurityGroup
SubnetIds: !Ref SubnetIds
Code:
ZipFile: |
{{> lambda.js }}touch stacks/dev/eu-west-1/lambda.ymltemplate: lambda.yml
parameters:
Environment: {{ stackGroup.data.environment }}
VpcId:
resolver: stack-output
stack: vpc.yml
output: VpcId
SubnetIds:
resolver: stack-output
stack: vpc.yml
output: SubnetIds
TableName:
resolver: stack-output
stack: dynamodb.yml
output: TableName
TableArn:
resolver: stack-output
stack: dynamodb.yml
output: TableArn.
ββ stacks
β ββ dev
β β ββ config.yml
β β ββ eu-west-1
β β ββ config.yml
β β ββ dynamodb.yml
β β ββ lambda.yml
β β ββ vpc.yml
β β ββ vpc-endpoints.yml
β ββ prod
β ββ eu-west-1
ββ templates
β ββ dynamodb.yml
β ββ vpc.yml
β ββ vpc-endpoints.yml
ββ package.jsonnpx tkm stacks deploy --profile takomo-tutorialaws lambda invoke \
--region eu-west-1 \
--function-name tutorial-function-dev \
--profile takomo-tutorial \
response.txttouch stacks/prod/config.ymldata:
environment: prodtouch stacks/prod/eu-west-1/config.ymlregions: eu-west-1touch stacks/prod/eu-west-1/dynamodb.yml
touch stacks/prod/eu-west-1/lambda.yml
touch stacks/prod/eu-west-1/vpc.yml
touch stacks/prod/eu-west-1/vpc-endpoints.ymltemplate: dynamodb.yml
parameters:
Environment: {{ stackGroup.data.environment }}template: lambda.yml
parameters:
Environment: {{ stackGroup.data.environment }}
VpcId:
resolver: stack-output
stack: vpc.yml
output: VpcId
SubnetIds:
resolver: stack-output
stack: vpc.yml
output: SubnetIds
TableName:
resolver: stack-output
stack: dynamodb.yml
output: TableName
TableArn:
resolver: stack-output
stack: dynamodb.yml
output: TableArntemplate: vpc.yml
parameters:
Environment: {{ stackGroup.data.environment }}
VpcCidr: 10.0.0.64/26template: vpc-endpoints.yml
parameters:
Environment: {{ stackGroup.data.environment }}
VpcId:
resolver: stack-output
stack: vpc.yml
output: VpcId
RouteTableIds:
resolver: stack-output
stack: vpc.yml
output: RouteTableIds.
ββ stacks
β ββ dev
β β ββ config.yml
β β ββ eu-west-1
β β ββ config.yml
β β ββ dynamodb.yml
β β ββ lambda.yml
β β ββ vpc.yml
β β ββ vpc-endpoints.yml
β ββ prod
β ββ config.yml
β ββ eu-west-1
β ββ config.yml
β ββ dynamodb.yml
β ββ lambda.yml
β ββ vpc.yml
β ββ vpc-endpoints.yml
ββ templates
β ββ dynamodb.yml
β ββ vpc.yml
β ββ vpc-endpoints.yml
ββ package.jsonnpx tkm stacks list --profile takomo-tutorialnpx tkm stacks deploy --profile takomo-tutorial -ynpx tkm stacks undeploy --profile takomo-tutorial