// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Evaluation Valid templates Cloudformation templates cloudformation/boolean-for-string.json 1`] = ` Object { "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "AccessControl": true, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/bucket-with-encryption-key.json 1`] = ` Object { "Resources": Object { "Bucket": Object { "DeletionPolicy": "Retain", "Metadata": Object { "KeyArn": Object { "Fn::GetAtt": Array [ "Key", "Arn", ], }, "KeyRef": Object { "Ref": "Key", }, "Object1": "Location1", }, "Properties": Object { "BucketEncryption": Object { "ServerSideEncryptionConfiguration": Array [ Object { "ServerSideEncryptionByDefault": Object { "KMSMasterKeyID": Object { "Fn::GetAtt": Array [ "Key", "Arn", ], }, "SSEAlgorithm": "aws:kms", }, }, ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Retain", }, "Key": Object { "DeletionPolicy": "Delete", "Properties": Object { "KeyPolicy": Object { "Statement": Array [ Object { "Action": Array [ "kms:*", ], "Effect": "Allow", "Principal": Object { "AWS": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::", Object { "Ref": "AWS::AccountId", }, ":root", ], ], }, }, "Resource": "*", }, ], "Version": "2012-10-17", }, }, "Type": "AWS::KMS::Key", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/bucket-with-parameters.json 1`] = ` Object { "Parameters": Object { "BucketName": Object { "AllowedPattern": "^[a-zA-Z0-9]*$", "ConstraintDescription": "a string consisting only of alphanumeric characters", "Default": "MyS3Bucket", "Description": "The name of your bucket", "MaxLength": 10, "MinLength": 1, "NoEcho": true, "Type": "String", }, "CorsMaxAge": Object { "AllowedValues": Array [ 1, 2, 3, 10, 100, 300, ], "Default": "3", "Description": "the time in seconds that a browser will cache the preflight response", "MaxValue": 300, "MinValue": 0, "NoEcho": true, "Type": "Number", }, }, "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Ref": "BucketName", }, "CorsConfiguration": Object { "CorsRules": Array [ Object { "AllowedMethods": Array [ "GET", "POST", ], "AllowedOrigins": Array [ "origin1", "origin2", ], "MaxAge": Object { "Ref": "CorsMaxAge", }, }, ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/condition-same-name-as-resource.json 1`] = ` Object { "Conditions": Object { "AlwaysFalse": Object { "Fn::Equals": Array [ Object { "Ref": "Param", }, 2, ], }, "AlwaysTrue": Object { "Fn::Not": Array [ Object { "Condition": "AlwaysFalse", }, ], }, }, "Parameters": Object { "Param": Object { "Type": "String", }, }, "Resources": Object { "AlwaysTrue": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::If": Array [ "AlwaysFalse", Object { "Ref": "Param", }, Object { "Ref": "AWS::NoValue", }, ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/condition-using-mapping.json 1`] = ` Object { "Conditions": Object { "AlwaysTrue": Object { "Fn::Equals": Array [ Object { "Fn::FindInMap": Array [ "Mapping01", "Key01", "Name", ], }, "Value01", ], }, }, "Mappings": Object { "Mapping01": Object { "Key01": Object { "Name": "Value01", }, }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/custom-resource-with-attributes.json 1`] = ` Object { "Conditions": Object { "AlwaysFalseCond": Object { "Fn::Equals": Array [ Object { "Ref": "AWS::Region", }, "completely-made-up-region", ], }, }, "Resources": Object { "CustomBucket": Object { "CreationPolicy": Object { "AutoScalingCreationPolicy": Object { "MinSuccessfulInstancesPercent": 90, }, }, "DeletionPolicy": "Retain", "DependsOn": Array [ "CustomResource", ], "Metadata": Object { "Object1": "Value1", "Object2": "Value2", }, "Type": "AWS::MyService::Custom", "UpdateReplacePolicy": "Delete", }, "CustomResource": Object { "DeletionPolicy": "Delete", "Properties": Object { "CustomFuncProp": Object { "Ref": "AWS::NoValue", }, "ServiceToken": "CustomValue", }, "Type": "AWS::CloudFormation::CustomResource", "UpdatePolicy": Object { "AutoScalingReplacingUpdate": Object { "WillReplace": "false", }, }, "UpdateReplacePolicy": "Retain", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/custom-resource-with-bad-condition.json 1`] = ` Object { "Resources": Object { "CustomResource": Object { "DeletionPolicy": "Delete", "Type": "AWS::MyService::Custom", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/find-in-map-for-boolean-property.json 1`] = ` Object { "Mappings": Object { "SomeMapping": Object { "region": Object { "key1": true, }, }, }, "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "PublicAccessBlockConfiguration": Object { "BlockPublicAcls": Object { "Fn::FindInMap": Array [ "SomeMapping", Object { "Ref": "AWS::Region", }, "key1", ], }, }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/find-in-map-with-dynamic-mapping.json 1`] = ` Object { "Mappings": Object { "beta": Object { "region": Object { "key1": "name", }, }, }, "Parameters": Object { "Stage": Object { "AllowedValues": Array [ "beta", ], "Default": "beta", "Type": "String", }, }, "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::FindInMap": Array [ Object { "Ref": "Stage", }, "region", "key1", ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/fn-select-with-novalue.json 1`] = ` Object { "Conditions": Object { "MyCondition": Object { "Fn::Equals": Array [ Object { "Ref": "DoIt", }, "Yes", ], }, }, "Parameters": Object { "DoIt": Object { "Type": "String", }, }, "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::Select": Array [ 0, Array [ Object { "Fn::If": Array [ "MyCondition", "doing-it", Object { "Ref": "AWS::NoValue", }, ], }, "not-doingit", ], ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/fn-sub-brace-edges.json 1`] = ` Object { "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "SymbolsAndResources": Object { "ClosingBrace": Object { "Fn::Sub": "DoesNotExist}DoesNotExist", }, "ClosingBraceDollar": Object { "Fn::Sub": "DoesNotExist}$DoesNotExist", }, "DollarClosingBrace": Object { "Fn::Sub": "DoesNotExist$}DoesNotExist", }, "DollarOpeningBrace": Object { "Fn::Sub": "DoesNotExist\${DoesNotExist", }, "DollarSign": Object { "Fn::Sub": "DoesNotExist$DoesNotExist", }, "OpeningBrace": Object { "Fn::Sub": "DoesNotExist{DoesNotExist", }, "OpeningBraceDollar": Object { "Fn::Sub": "DoesNotExist{$DoesNotExist", }, }, "SymbolsOnly": Object { "ClosingBrace": Object { "Fn::Sub": "}", }, "ClosingBraceDollar": Object { "Fn::Sub": "}$", }, "DollarClosingBrace": Object { "Fn::Sub": "$}", }, "DollarOpeningBrace": Object { "Fn::Sub": "\${", }, "DollarSign": Object { "Fn::Sub": "$", }, "OpeningBrace": Object { "Fn::Sub": "{", }, "OpeningBraceDollar": Object { "Fn::Sub": "{$", }, }, }, "Type": "Custom::ManyStrings", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/fn-sub-escaping.json 1`] = ` Object { "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::Sub": "some-bucket\${!AWS::AccountId}7896\${ ! DoesNotExist}\${!Immediate}234", }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/fn-sub-map-dotted-attributes.json 1`] = ` Object { "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::Sub": Array [ "\${ELB.SourceSecurityGroup.GroupName}-\${LoadBalancerName}", Object { "LoadBalancerName": Object { "Ref": "ELB", }, }, ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "ELB": Object { "DeletionPolicy": "Delete", "Properties": Object { "AvailabilityZones": Array [ "us-east-1a", ], "CrossZone": true, "Listeners": Array [ Object { "InstancePort": "80", "LoadBalancerPort": "80", "Protocol": "HTTP", }, ], }, "Type": "AWS::ElasticLoadBalancing::LoadBalancer", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/fn-sub-map-empty.json 1`] = ` Object { "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::Sub": "my-bucket", }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/fn-sub-override.json 1`] = ` Object { "Resources": Object { "AnotherBucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::Sub": "\${Bucket}-\${!Bucket}-\${Bucket.DomainName}", }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": "bucket", }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/fn-sub-parameters.json 1`] = ` Object { "Parameters": Object { "MyParam": Object { "Type": "String", }, }, "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::Sub": "\${MyParam}", }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/fn-sub-shadow.json 1`] = ` Object { "Resources": Object { "AnotherBucket": Object { "DeletionPolicy": "Delete", "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::Sub": Array [ "\${AnotherBucket}", Object { "AnotherBucket": Object { "Ref": "AnotherBucket", }, }, ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/fn-sub-shadow-attribute.json 1`] = ` Object { "Resources": Object { "AnotherBucket": Object { "DeletionPolicy": "Delete", "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::Sub": Array [ "\${AnotherBucket.DomainName}", Object { "AnotherBucket": "whatever", }, ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/fn-sub-shadow-parameter.json 1`] = ` Object { "Parameters": Object { "MyParam": Object { "Type": "String", }, }, "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::Sub": Array [ "\${MyParam}", Object { "MyParam": Object { "Ref": "MyParam", }, }, ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/fn-sub-string.json 1`] = ` Object { "Resources": Object { "AnotherBucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::Sub": "1-\${AWS::Region}-foo-\${Bucket}-\${!Literal}-\${Bucket.DomainName}-\${AWS::Region}", }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": "bucket", }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/get-att-string-form.json 1`] = ` Object { "Resources": Object { "Bucket1": Object { "DeletionPolicy": "Delete", "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "Bucket2": Object { "DeletionPolicy": "Delete", "Metadata": Object { "Bucket1Arn": Object { "Fn::GetAtt": "Bucket1.Arn", }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/hook-code-deploy-blue-green-ecs.json 1`] = ` Object { "Hooks": Object { "EcsBlueGreenCodeDeployHook": Object { "Properties": Object { "AdditionalOptions": Object { "fields": Object { "TerminationWaitTimeInMinutes": Object { "type": "number", "value": 5, }, }, "type": "object", }, "Applications": Object { "array": Array [ Object { "fields": Object { "ECSAttributes": Object { "fields": Object { "TaskDefinitions": Object { "array": Array [ Object { "type": "string", "value": "MyTaskDefinition", }, Object { "type": "string", "value": "MyTaskDefinition", }, ], "type": "array", }, "TaskSets": Object { "array": Array [ Object { "type": "string", "value": "MyTaskSet", }, Object { "type": "string", "value": "MyTaskSet", }, ], "type": "array", }, "TrafficRouting": Object { "fields": Object { "ProdTrafficRoute": Object { "fields": Object { "LogicalID": Object { "type": "string", "value": "AlbListener", }, "Type": Object { "type": "string", "value": "AWS::ElasticLoadBalancingV2::Listener", }, }, "type": "object", }, "TargetGroups": Object { "array": Array [ Object { "type": "string", "value": "AlbTargetGroup", }, Object { "type": "string", "value": "AlbTargetGroup", }, ], "type": "array", }, "TestTrafficRoute": Object { "fields": Object { "LogicalID": Object { "type": "string", "value": "AlbListener", }, "Type": Object { "type": "string", "value": "AWS::ElasticLoadBalancingV2::Listener", }, }, "type": "object", }, }, "type": "object", }, }, "type": "object", }, "Target": Object { "fields": Object { "LogicalID": Object { "type": "string", "value": "MyService", }, "Type": Object { "type": "string", "value": "AWS::ECS::Service", }, }, "type": "object", }, }, "type": "object", }, ], "type": "array", }, "LifecycleEventHooks": Object { "fields": Object { "AfterAllowTestTraffic": Object { "type": "string", "value": "f3", }, "AfterAllowTraffic": Object { "type": "string", "value": "f5", }, "AfterInstall": Object { "type": "string", "value": "f2", }, "BeforeAllowTraffic": Object { "type": "string", "value": "f4", }, "BeforeInstall": Object { "type": "string", "value": "f1", }, }, "type": "object", }, "ServiceRole": Object { "type": "string", "value": "CodeDeployServiceRoleName", }, "TrafficRoutingConfig": Object { "fields": Object { "TimeBasedCanary": Object { "fields": Object { "BakeTimeMins": Object { "type": "string", "value": "2", }, "StepPercentage": Object { "type": "number", "value": 1, }, }, "type": "object", }, "TimeBasedLinear": Object { "fields": Object { "BakeTimeMins": Object { "type": "number", "value": 4, }, "StepPercentage": Object { "type": "string", "value": "3", }, }, "type": "object", }, "Type": Object { "type": "string", "value": "AllAtOnce", }, }, "type": "object", }, }, "Type": "AWS::CodeDeploy::BlueGreen", }, "RandomHook": Object { "Type": "UnknownToday", }, }, "Resources": Object { "AlbListener": Object { "DeletionPolicy": "Delete", "Properties": Object { "DefaultActions": Array [ Object { "Type": "forward", }, ], "LoadBalancerArn": "my-lb", "Port": 80, "Protocol": "HTTP", }, "Type": "AWS::ElasticLoadBalancingV2::Listener", "UpdateReplacePolicy": "Delete", }, "AlbTargetGroup": Object { "DeletionPolicy": "Delete", "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", "UpdateReplacePolicy": "Delete", }, "MyService": Object { "DeletionPolicy": "Delete", "Type": "AWS::ECS::Service", "UpdateReplacePolicy": "Delete", }, "MyTaskDefinition": Object { "DeletionPolicy": "Delete", "Type": "AWS::ECS::TaskDefinition", "UpdateReplacePolicy": "Delete", }, "MyTaskSet": Object { "DeletionPolicy": "Delete", "Properties": Object { "Cluster": "my-cluster", "Service": Object { "Ref": "MyService", }, "TaskDefinition": Object { "Fn::Sub": "\${MyTaskDefinition}", }, }, "Type": "AWS::ECS::TaskSet", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/if-complex-property.json 1`] = ` Object { "Conditions": Object { "AlwaysFalseCond": Object { "Fn::Equals": Array [ Object { "Ref": "AWS::Region", }, "completely-made-up-region", ], }, }, "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "CorsConfiguration": Object { "CorsRules": Array [ Object { "Fn::If": Array [ "AlwaysFalseCond", Object { "AllowedMethods": Array [ "GET", ], "AllowedOrigins": Array [ "*", ], "MaxAge": 10, }, Object { "AllowedMethods": Array [ "POST", ], "AllowedOrigins": Array [ "/path/*", ], "MaxAge": 20, }, ], }, ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/if-in-tags.json 1`] = ` Object { "Conditions": Object { "ValcacheServerEnabled": Object { "Fn::Equals": Array [ Object { "Ref": "EnvType", }, "prod", ], }, }, "Parameters": Object { "EnvType": Object { "AllowedValues": Array [ "prod", "test", ], "Default": "test", "Type": "String", }, }, "Resources": Object { "TxAutoScalingGroup": Object { "DeletionPolicy": "Delete", "Properties": Object { "MaxSize": "3", "MinSize": "1", "Tags": Array [ Object { "Fn::If": Array [ "ValcacheServerEnabled", Object { "Key": "datomic:cache-group", "PropagateAtLaunch": true, "Value": "SystemName", }, Object { "Ref": "AWS::NoValue", }, ], }, ], }, "Type": "AWS::AutoScaling::AutoScalingGroup", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/if-simple-property.json 1`] = ` Object { "Conditions": Object { "AlwaysFalseCond": Object { "Fn::Equals": Array [ Object { "Ref": "AWS::Region", }, "completely-made-up-region", ], }, }, "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::If": Array [ "AlwaysFalseCond", "Name1", "Name2", ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/json-in-fn-sub.yaml 1`] = ` Object { "AWSTemplateFormatVersion": "2010-09-09", "Parameters": Object { "Stage": Object { "Type": "String", }, }, "Resources": Object { "Dashboard": Object { "DeletionPolicy": "Delete", "Properties": Object { "DashboardBody": Object { "Fn::Sub": "{ \\"widgets\\": [ { \\"type\\": \\"text\\", \\"properties\\": { \\"markdown\\": \\"\${Stage} \${Stage}\\" } }, { \\"type\\": \\"text\\", \\"properties\\": { \\"markdown\\": \\"\${Stage} \${Stage}\\" } } ] } ", }, "DashboardName": Object { "Fn::Sub": "\${Stage}-Dashboard", }, }, "Type": "AWS::CloudWatch::Dashboard", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/long-form-subnet.yaml 1`] = ` Object { "Conditions": Object { "AlwaysTrueCond": Object { "Fn::Not": Array [ Object { "Fn::Equals": Array [ Object { "Ref": "AWS::Region", }, "completely-made-up-region", ], }, ], }, }, "Resources": Object { "Bucket1": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": "SomeBucketName", }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "Bucket2": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::GetAtt": Array [ "Bucket1", "Arn", ], }, "CorsConfiguration": Object { "CorsRules": Array [ Object { "AllowedMethods": Array [ "GET", "POST", ], "AllowedOrigins": Array [ Object { "Fn::Join": Array [ "", Array [ Object { "Ref": "Bucket1", }, "1", ], ], }, "origin2", ], "MaxAge": 2, }, ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "Subnet": Object { "DeletionPolicy": "Delete", "Properties": Object { "AvailabilityZone": Object { "Fn::Select": Array [ "0", Object { "Fn::GetAZs": "", }, ], }, "CidrBlock": "10.0.0.0/24", "VpcId": Object { "Fn::If": Array [ "AlwaysTrueCond", Object { "Fn::Select": Array [ 0, Object { "Fn::Split": Array [ ",", Object { "Fn::ImportValue": "ImportedVpcId", }, ], }, ], }, Object { "Fn::Select": Array [ 0, Object { "Fn::GetAZs": "eu-west-2", }, ], }, ], }, }, "Type": "AWS::EC2::Subnet", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/long-form-vpc.yaml 1`] = ` Object { "Conditions": Object { "AlwaysTrueCond": Object { "Fn::And": Array [ Object { "Fn::Not": Array [ Object { "Fn::Equals": Array [ Object { "Ref": "AWS::Region", }, "completely-made-up-region", ], }, ], }, Object { "Fn::Or": Array [ Object { "Fn::Equals": Array [ Object { "Ref": "AWS::Region", }, "completely-made-up-region", ], }, Object { "Fn::Equals": Array [ Object { "Ref": "AWS::Region", }, "completely-made-up-region", ], }, ], }, ], }, }, "Mappings": Object { "RegionMap": Object { "region-1": Object { "HVM64": "name1", "HVMG2": "name2", }, }, }, "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "AccessControl": Object { "Fn::ImportValue": Object { "Fn::Sub": Array [ "\${Region}-foo-\${!Immediate}-foo-\${Vpc}-\${Vpc.Id}-\${Name}", Object { "Name": Object { "Ref": "Vpc", }, "Region": Object { "Fn::Base64": "AWS::Region", }, }, ], }, }, "BucketName": Object { "Fn::If": Array [ "AlwaysTrueCond", Object { "Fn::FindInMap": Array [ "RegionMap", "region-1", "HVM64", ], }, Object { "Fn::Transform": Object { "Name": "AWS::Include", "Parameters": Object { "AnotherParameter": Object { "Fn::Base64": "AnotherValue", }, "Location": "location,", }, }, }, ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "Vpc": Object { "DeletionPolicy": "Delete", "Properties": Object { "CidrBlock": Object { "Fn::If": Array [ "AlwaysTrueCond", Object { "Fn::Cidr": Array [ "192.168.1.1/24", 2, 5, ], }, Object { "Fn::Cidr": Array [ "10.0.0.0/24", "6", "5", ], }, ], }, }, "Type": "AWS::EC2::VPC", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/non-existent-resource-attribute.json 1`] = ` Object { "Resources": Object { "Bucket2": Object { "DeletionPolicy": "Delete", "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/number-for-string.json 1`] = ` Object { "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "WebsiteConfiguration": Object { "RoutingRules": Array [ Object { "RedirectRule": Object { "HttpRedirectCode": 403, }, }, ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/only-bucket-complex-props.json 1`] = ` Object { "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "CorsConfiguration": Object { "CorsRules": Array [ Object { "AllowedMethods": Array [ "GET", ], "AllowedOrigins": Array [ "*", ], "MaxAge": 10, }, ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/only-empty-bucket.json 1`] = ` Object { "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/only-empty-bucket-with-parameters.json 1`] = ` Object { "AWSTemplateFormatVersion": "2010-09-09", "Conditions": Object { "Cond1": Object { "Fn::Equals": Array [ "a", "b", ], }, }, "Description": "My template description", "Mappings": Object { "Mapping01": Object { "Key01": Object { "Name": "Value01", }, }, }, "Metadata": Object { "Instances": Object { "Description": "Information about the instances", }, }, "Outputs": Object { "Output1": Object { "Value": Object { "Fn::If": Array [ "Cond1", Object { "Fn::Base64": "Output1Value", }, Object { "Fn::GetAtt": Array [ "Bucket", "DualStackDomainName", ], }, ], }, }, }, "Parameters": Object { "Param": Object { "Default": "", "Description": "The description of the parameter", "Type": "String", }, }, "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, "Transform": "AWS::Serverless-2016-10-31", } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/only-mapping-and-bucket.json 1`] = ` Object { "Mappings": Object { "SomeMapping": Object { "region": Object { "key1": "value1", }, }, }, "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::FindInMap": Array [ "SomeMapping", Object { "Ref": "AWS::Region", }, "key1", ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/only-parameters-and-rule.json 1`] = ` Object { "Conditions": Object { "IsProduction": Object { "Fn::Equals": Array [ Object { "Ref": "Env", }, "prod", ], }, }, "Parameters": Object { "Env": Object { "Type": "String", }, "Subnets": Object { "Type": "List", }, }, "Rules": Object { "TestVpcRule": Object { "Assertions": Array [ Object { "Assert": Object { "Fn::EachMemberIn": Array [ Object { "Fn::ValueOfAll": Array [ "AWS::EC2::Subnet::Id", "VpcId", ], }, Object { "Fn::ValueOf": Array [ "Subnets", "VpcId", ], }, ], }, }, ], "RuleCondition": Object { "Fn::Contains": Array [ Array [ "test", "pre-prod", "preprod", ], Object { "Ref": "Env", }, ], }, }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/outputs-with-references.json 1`] = ` Object { "Conditions": Object { "AlwaysFalseCond": Object { "Fn::Equals": Array [ Object { "Ref": "AWS::Region", }, "completely-made-up-region", ], }, }, "Outputs": Object { "Output1": Object { "Condition": "AlwaysFalseCond", "Description": "a description", "Export": Object { "Name": "Bucket", }, "Value": Object { "Fn::Join": Array [ "", Array [ Object { "Ref": "MyParam", }, Object { "Fn::GetAtt": Array [ "Bucket", "Arn", ], }, ], ], }, }, "OutputWithNoCondition": Object { "Value": "some-value", }, }, "Parameters": Object { "MyParam": Object { "Type": "String", }, }, "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "Output1": Object { "DeletionPolicy": "Delete", "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/parameter-references.json 1`] = ` Object { "Conditions": Object { "AlwaysFalse": Object { "Fn::Equals": Array [ Object { "Ref": "MyParam", }, "Invalid?BucketName", ], }, }, "Metadata": Object { "Field": Object { "Fn::If": Array [ "AlwaysFalse", "AWS::NoValue", Object { "Ref": "MyParam", }, ], }, }, "Outputs": Object { "MyOutput": Object { "Value": Object { "Ref": "MyParam", }, }, }, "Parameters": Object { "MyParam": Object { "Default": "MyValue", "Type": "String", }, }, "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Metadata": Object { "Field": Object { "Ref": "MyParam", }, }, "Properties": Object { "BucketName": Object { "Ref": "MyParam", }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, "Transform": Object { "Name": "AWS::Include", "Parameters": Object { "Location": Object { "Ref": "MyParam", }, }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/properties-not-in-cfn-spec.json 1`] = ` Object { "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "AccelerateConfiguration": Object { "AccelerationStatus": "Enabled", "PropertyNotInCfnSchema": false, }, "CorsConfiguration": Object { "CorsRules": Array [ Object { "AllowedMethods": Array [ "GET", ], "AllowedOrigins": Array [ "origin1", ], "MaxAge": 5, "PropertyNotInCfnSchema": "unmodeled property in array", }, ], }, "PropertyNotInCfnSchema": 1, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "Function": Object { "DeletionPolicy": "Delete", "Properties": Object { "CodeUri": Object { "Bucket": "bucket", "Key": "key", }, "Events": Object { "Api": Object { "Properties": Object { "Method": "GET", "Path": "/", }, "PropertyNotInCfnSchema": "unmodeled property in map", "Type": "Api", }, }, "Handler": "index.handler", "ParentPropertyNotInCfnSchema": Object { "ChildPropertyNotInCfnSchema": Object { "Ref": "Bucket", }, }, "Runtime": "nodejs14.x", }, "Type": "AWS::Serverless::Function", "UpdateReplacePolicy": "Delete", }, }, "Transform": "AWS::Serverless-2016-10-31", } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/ref-array-property.json 1`] = ` Object { "Parameters": Object { "Methods": Object { "Default": "GET,PUT", "Description": "The description of the parameter", "Type": "CommaDelimitedList", }, }, "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "CorsConfiguration": Object { "CorsRules": Array [ Object { "AllowedMethods": Object { "Ref": "Methods", }, "AllowedOrigins": Array [ "/path/*", ], "MaxAge": 20, }, ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/resource-attribute-condition.json 1`] = ` Object { "Conditions": Object { "AlwaysFalseCond": Object { "Fn::Equals": Array [ Object { "Ref": "AWS::Region", }, "completely-made-up-region", ], }, }, "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/resource-attribute-creation-policy.json 1`] = ` Object { "Parameters": Object { "CountParameter": Object { "Default": 3, "Type": "Number", }, }, "Resources": Object { "Bucket": Object { "CreationPolicy": Object { "AutoScalingCreationPolicy": Object { "MinSuccessfulInstancesPercent": 50, }, "ResourceSignal": Object { "Count": Object { "Ref": "CountParameter", }, "Timeout": "PT5H4M3S", }, }, "DeletionPolicy": "Delete", "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/resource-attribute-depends-on.json 1`] = ` Object { "Resources": Object { "Bucket1": Object { "DeletionPolicy": "Delete", "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "Bucket2": Object { "DeletionPolicy": "Delete", "DependsOn": Array [ "Bucket1", ], "Properties": Object { "BucketName": "bucket2", }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/resource-attribute-depends-on-array.json 1`] = ` Object { "Resources": Object { "Bucket0": Object { "DeletionPolicy": "Delete", "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "Bucket1": Object { "DeletionPolicy": "Delete", "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "Bucket2": Object { "DeletionPolicy": "Delete", "DependsOn": Array [ "Bucket0", "Bucket1", ], "Properties": Object { "BucketName": "bucket2", }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/resource-attribute-update-policy.json 1`] = ` Object { "Parameters": Object { "WaitOnResourceSignals": Object { "Default": "true", "Type": "String", }, }, "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Type": "AWS::S3::Bucket", "UpdatePolicy": Object { "AutoScalingReplacingUpdate": Object { "WillReplace": false, }, "AutoScalingRollingUpdate": Object { "MaxBatchSize": 1, "MinInstancesInService": 2, "MinSuccessfulInstancesPercent": 3, "PauseTime": "PT4M3S", "SuspendProcesses": Array [ "Launch", "Terminate", "HealthCheck", "ReplaceUnhealthy", "AZRebalance", "AlarmNotification", "ScheduledActions", "AddToLoadBalancer", ], "WaitOnResourceSignals": Object { "Fn::Equals": Array [ "true", Object { "Ref": "WaitOnResourceSignals", }, ], }, }, "AutoScalingScheduledAction": Object { "IgnoreUnmodifiedGroupSizeProperties": true, }, "CodeDeployLambdaAliasUpdate": Object { "AfterAllowTrafficHook": "Lambda1", "ApplicationName": Object { "Ref": "CodeDeployApp", }, "BeforeAllowTrafficHook": "Lambda2", "DeploymentGroupName": Object { "Ref": "CodeDeployDg", }, }, "EnableVersionUpgrade": true, "UseOnlineResharding": false, }, "UpdateReplacePolicy": "Delete", }, "CodeDeployApp": Object { "DeletionPolicy": "Delete", "Type": "AWS::CodeDeploy::Application", "UpdateReplacePolicy": "Delete", }, "CodeDeployDg": Object { "DeletionPolicy": "Delete", "Properties": Object { "ApplicationName": Object { "Ref": "CodeDeployApp", }, "ServiceRoleArn": "my-role-arn", }, "Type": "AWS::CodeDeploy::DeploymentGroup", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/short-form-base64.yaml 1`] = ` Object { "Resources": Object { "Base64Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::Base64": "NonBase64BucketName", }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/short-form-cidr.yaml 1`] = ` Object { "Resources": Object { "CidrVpc1": Object { "DeletionPolicy": "Delete", "Properties": Object { "CidrBlock": Object { "Fn::Cidr": Array [ "192.168.1.1/24", 2, 5, ], }, }, "Type": "AWS::EC2::VPC", "UpdateReplacePolicy": "Delete", }, "CidrVpc2": Object { "DeletionPolicy": "Delete", "Properties": Object { "CidrBlock": Object { "Fn::Cidr": Array [ "192.168.1.1/24", "2", "5", ], }, }, "Type": "AWS::EC2::VPC", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/short-form-conditionals.yaml 1`] = ` Object { "Conditions": Object { "AlwaysTrueCond": Object { "Fn::And": Array [ Object { "Fn::Not": Array [ Object { "Fn::Equals": Array [ Object { "Ref": "AWS::Region", }, "completely-made-up-region", ], }, ], }, Object { "Fn::Or": Array [ Object { "Fn::Equals": Array [ Object { "Ref": "AWS::Region", }, "completely-made-up-region", ], }, Object { "Fn::Equals": Array [ Object { "Ref": "AWS::Region", }, "completely-made-up-region", ], }, ], }, ], }, }, "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::If": Array [ "AlwaysTrueCond", "MyBucketName", Object { "Ref": "AWS::NoValue", }, ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/short-form-conditions.yaml 1`] = ` Object { "Conditions": Object { "AlwaysTrueCond": Object { "Fn::Not": Array [ Object { "Fn::Equals": Array [ Object { "Ref": "AWS::Region", }, "completely-made-up-region1", ], }, ], }, "AnotherAlwaysTrueCond": Object { "Fn::Not": Array [ Object { "Fn::Equals": Array [ Object { "Ref": "AWS::Region", }, "completely-made-up-region2", ], }, ], }, "CombinedCond": Object { "Fn::Or": Array [ Object { "Condition": "AlwaysTrueCond", }, Object { "Condition": "AnotherAlwaysTrueCond", }, Object { "Condition": "ThirdAlwaysTrueCond", }, ], }, "ThirdAlwaysTrueCond": Object { "Fn::Not": Array [ Object { "Fn::Equals": Array [ Object { "Ref": "AWS::Region", }, "completely-made-up-region3", ], }, ], }, }, "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::If": Array [ "CombinedCond", "MyBucketName", Object { "Ref": "AWS::NoValue", }, ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/short-form-find-in-map.yaml 1`] = ` Object { "Mappings": Object { "RegionMap": Object { "region-1": Object { "HVM64": "name1", "HVMG2": "name2", }, }, }, "Resources": Object { "Bucket1": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::FindInMap": Array [ "RegionMap", "region-1", "HVM64", ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "Bucket2": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::FindInMap": Array [ "RegionMap", "region-1", "HVMG2", ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/short-form-fnsub-string.yaml 1`] = ` Object { "Resources": Object { "AnotherBucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::Sub": "1-\${AWS::Region}-foo-\${Bucket}-\${!Literal}-\${Bucket.DomainName}-\${AWS::Region}", }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::Sub": "some-bucket\${!AWS::AccountId}7896\${ ! AWS::Region}1-1\${!Immediate}234", }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/short-form-get-att.yaml 1`] = ` Object { "Resources": Object { "Bucket0": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": "some-bucket", }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "Bucket1": Object { "DeletionPolicy": "Delete", "Properties": Object { "AccessControl": Object { "Fn::GetAtt": Array [ "ELB", "SourceSecurityGroup.GroupName", ], }, "BucketName": Object { "Fn::GetAtt": Array [ "Bucket0", "Arn", ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "Bucket2": Object { "DeletionPolicy": "Delete", "Properties": Object { "AccessControl": Object { "Fn::GetAtt": Array [ "ELB", "SourceSecurityGroup.GroupName", ], }, "BucketName": Object { "Fn::GetAtt": Array [ "Bucket1", "Arn", ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "ELB": Object { "DeletionPolicy": "Delete", "Properties": Object { "AvailabilityZones": Array [ "us-east-1a", ], "Listeners": Array [ Object { "InstancePort": "80", "LoadBalancerPort": "80", "Protocol": "HTTP", }, ], }, "Type": "AWS::ElasticLoadBalancing::LoadBalancer", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/short-form-import-value.yaml 1`] = ` Object { "Resources": Object { "Bucket1": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::ImportValue": "SomeSharedValue", }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/short-form-join.yaml 1`] = ` Object { "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::Join": Array [ " ", Array [ "NamePart1 ", Object { "Fn::ImportValue": "SomeSharedValue", }, ], ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/short-form-select.yaml 1`] = ` Object { "Resources": Object { "Subnet1": Object { "DeletionPolicy": "Delete", "Properties": Object { "AvailabilityZone": Object { "Fn::Select": Array [ "0", Object { "Fn::GetAZs": "eu-west-2", }, ], }, "CidrBlock": "10.0.0.0/24", "VpcId": Object { "Fn::Select": Array [ 0, Object { "Fn::GetAZs": "", }, ], }, }, "Type": "AWS::EC2::Subnet", "UpdateReplacePolicy": "Delete", }, "Subnet2": Object { "DeletionPolicy": "Delete", "Properties": Object { "AvailabilityZone": Object { "Fn::Select": Array [ 0, Object { "Fn::GetAZs": "eu-west-2", }, ], }, "CidrBlock": "10.0.0.0/24", "VpcId": Object { "Ref": "Subnet1", }, }, "Type": "AWS::EC2::Subnet", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/short-form-split.yaml 1`] = ` Object { "Resources": Object { "Bucket1": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::Split": Array [ " ", Object { "Fn::ImportValue": "SomeSharedBucketName", }, ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "Bucket2": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::Split": Array [ " ", Object { "Fn::ImportValue": "SomeSharedBucketName", }, ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/short-form-sub-map.yaml 1`] = ` Object { "Resources": Object { "AnotherBucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": "another-bucket", }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::Sub": Array [ "\${Region}-foo-\${!Immediate}-foo-\${AnotherBucket}-\${AnotherBucket.DomainName}-\${Name}", Object { "Name": Object { "Ref": "AnotherBucket", }, "Region": Object { "Fn::Base64": "AWS::Region", }, }, ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/ssm-association.json 1`] = ` Object { "Resources": Object { "Association": Object { "DeletionPolicy": "Delete", "Properties": Object { "Name": "association", "Parameters": Object { "P1": Array [ "a", "b", ], "p2": Array [], }, }, "Type": "AWS::SSM::Association", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/string-for-number.json 1`] = ` Object { "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "CorsConfiguration": Object { "CorsRules": Array [ Object { "AllowedMethods": Array [ "GET", ], "AllowedOrigins": Array [ "*", ], "MaxAge": "10", }, ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/user-data.json 1`] = ` Object { "Resources": Object { "LaunchConfig": Object { "DeletionPolicy": "Delete", "Properties": Object { "ImageId": "ami-01e24be29428c15b2", "InstanceType": "t1.micro", "UserData": Object { "Fn::Base64": Object { "Fn::Join": Array [ "", Array [ "#!/bin/bash -xe yum update -y aws-cfn-bootstrap /opt/aws/bin/cfn-init -v --stack ", Object { "Ref": "AWS::StackName", }, " --resource LaunchConfig --configsets wordpress_install --region ", Object { "Ref": "AWS::Region", }, " /opt/aws/bin/cfn-signal -e $? --stack ", Object { "Ref": "AWS::StackName", }, " --resource WebServerGroup --region ", Object { "Ref": "AWS::Region", }, " ", ], ], }, }, }, "Type": "AWS::AutoScaling::LaunchConfiguration", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Cloudformation templates cloudformation/year-month-date-as-strings.yaml 1`] = ` Object { "AWSTemplateFormatVersion": "2010-09-09", "Resources": Object { "Role": Object { "DeletionPolicy": "Delete", "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": Array [ "sts:AssumeRole", ], "Effect": "Allow", "Principal": Object { "Service": Array [ "ec2.amazonaws.com", ], }, }, ], "Version": "2012-10-17", }, }, "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Nested Stacks templates nested/child-import-stack.expected.json 1`] = ` Object { "Parameters": Object { "MyBucketParameter": Object { "Default": "default-bucket-param-name", "Type": "String", }, "referencetoAssetParameters5dc7d4a99cfe2979687dc74f2db9fd75f253b5505a1912b5ceecf70c9aefba50S3BucketEAA24F0CRef": Object { "Type": "String", }, "referencetoAssetParameters5dc7d4a99cfe2979687dc74f2db9fd75f253b5505a1912b5ceecf70c9aefba50S3VersionKey1194CAB2Ref": Object { "Type": "String", }, }, "Resources": Object { "BucketImport": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Ref": "MyBucketParameter", }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "GrandChildStack": Object { "DeletionPolicy": "Delete", "Properties": Object { "Parameters": Object { "MyBucketParameter": "some-other-bucket-name", }, "TemplateURL": Object { "Fn::Join": Array [ "", Array [ "https://s3.", Object { "Ref": "AWS::Region", }, ".", Object { "Ref": "AWS::URLSuffix", }, "/", Object { "Ref": "referencetoAssetParameters5dc7d4a99cfe2979687dc74f2db9fd75f253b5505a1912b5ceecf70c9aefba50S3BucketEAA24F0CRef", }, "/", Object { "Fn::Select": Array [ 0, Object { "Fn::Split": Array [ "||", Object { "Ref": "referencetoAssetParameters5dc7d4a99cfe2979687dc74f2db9fd75f253b5505a1912b5ceecf70c9aefba50S3VersionKey1194CAB2Ref", }, ], }, ], }, Object { "Fn::Select": Array [ 1, Object { "Fn::Split": Array [ "||", Object { "Ref": "referencetoAssetParameters5dc7d4a99cfe2979687dc74f2db9fd75f253b5505a1912b5ceecf70c9aefba50S3VersionKey1194CAB2Ref", }, ], }, ], }, ], ], }, }, "Type": "AWS::CloudFormation::Stack", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Nested Stacks templates nested/child-import-stack.json 1`] = ` Object { "Parameters": Object { "MyBucketParameter": Object { "Default": "default-bucket-param-name", "Type": "String", }, }, "Resources": Object { "BucketImport": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Ref": "MyBucketParameter", }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "GrandChildStack": Object { "DeletionPolicy": "Delete", "Properties": Object { "Parameters": Object { "MyBucketParameter": "some-other-bucket-name", }, "TemplateURL": "https://cfn-templates-set.s3.amazonaws.com/grandchild-import-stack.json", }, "Type": "AWS::CloudFormation::Stack", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Nested Stacks templates nested/child-no-bucket.json 1`] = ` Object { "Parameters": Object { "MyBucketParameter": Object { "Default": "default-bucket-param-name", "Type": "String", }, }, "Resources": Object { "GrandChildStack": Object { "DeletionPolicy": "Delete", "Properties": Object { "Parameters": Object { "MyBucketParameter": "some-other-bucket-name", }, "TemplateURL": "https://cfn-templates-set.s3.amazonaws.com/grandchild-import-stack.json", }, "Type": "AWS::CloudFormation::Stack", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Nested Stacks templates nested/child-two-parameters.json 1`] = ` Object { "Parameters": Object { "FirstParameter": Object { "Type": "String", }, "SecondParameter": Object { "Type": "String", }, }, "Resources": Object { "BucketImport": Object { "DeletionPolicy": "Delete", "Properties": Object { "AccessControl": Object { "Ref": "SecondParameter", }, "BucketName": Object { "Ref": "FirstParameter", }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "GrandChildStack": Object { "DeletionPolicy": "Delete", "Properties": Object { "Parameters": Object { "FirstParameter": Object { "Ref": "FirstParameter", }, }, "TemplateURL": "https://cfn-templates-set.s3.amazonaws.com/grandchild-import-stack.json", }, "Type": "AWS::CloudFormation::Stack", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Nested Stacks templates nested/child-with-number-parameter.yaml 1`] = ` Object { "AWSTemplateFormatVersion": "2010-09-09", "Parameters": Object { "Number": Object { "Type": "Number", }, }, "Resources": Object { "S3Bucket": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": "testbucket1234unique", }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Nested Stacks templates nested/cross-stack-refs.json 1`] = ` Object { "Parameters": Object { "Param": Object { "Type": "String", }, }, "Resources": Object { "Bucket": Object { "DeletionPolicy": "Delete", "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "ChildStack": Object { "DeletionPolicy": "Delete", "Properties": Object { "Parameters": Object { "Param1": Object { "Ref": "Param", }, "Param2": Object { "Fn::GetAtt": Array [ "Bucket", "Arn", ], }, }, "TemplateURL": "https://cfn-templates-set.s3.amazonaws.com/child-import-stack.json", }, "Type": "AWS::CloudFormation::Stack", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Nested Stacks templates nested/custom-resource.json 1`] = ` Object { "Resources": Object { "CustomResource": Object { "DeletionPolicy": "Delete", "Type": "AWS::CustomResource::Type", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Nested Stacks templates nested/grandchild-import-stack.json 1`] = ` Object { "Parameters": Object { "MyBucketParameter": Object { "Default": "default-bucket-param-name", "Type": "String", }, }, "Resources": Object { "BucketImport": Object { "DeletionPolicy": "Delete", "Properties": Object { "BucketName": Object { "Fn::Join": Array [ "-", Array [ "bucket-name-prefix", Object { "Ref": "MyBucketParameter", }, ], ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Nested Stacks templates nested/only-nested-stack.expected.json 1`] = ` Object { "Parameters": Object { "AssetParameters6b884775090ed88cd1a143f64442a92a6c34eaeff3857976d15ef2e3beee05d7ArtifactHash605B2835": Object { "Description": "Artifact hash for asset \\"6b884775090ed88cd1a143f64442a92a6c34eaeff3857976d15ef2e3beee05d7\\"", "Type": "String", }, "AssetParameters6b884775090ed88cd1a143f64442a92a6c34eaeff3857976d15ef2e3beee05d7S3BucketC8A1BF52": Object { "Description": "S3 bucket for asset \\"6b884775090ed88cd1a143f64442a92a6c34eaeff3857976d15ef2e3beee05d7\\"", "Type": "String", }, "AssetParameters6b884775090ed88cd1a143f64442a92a6c34eaeff3857976d15ef2e3beee05d7S3VersionKeyA9E03E19": Object { "Description": "S3 key for asset version \\"6b884775090ed88cd1a143f64442a92a6c34eaeff3857976d15ef2e3beee05d7\\"", "Type": "String", }, }, "Resources": Object { "NestedStack": Object { "DeletionPolicy": "Delete", "Properties": Object { "TemplateURL": Object { "Fn::Join": Array [ "", Array [ "https://s3.", Object { "Ref": "AWS::Region", }, ".", Object { "Ref": "AWS::URLSuffix", }, "/", Object { "Ref": "AssetParameters6b884775090ed88cd1a143f64442a92a6c34eaeff3857976d15ef2e3beee05d7S3BucketC8A1BF52", }, "/", Object { "Fn::Select": Array [ 0, Object { "Fn::Split": Array [ "||", Object { "Ref": "AssetParameters6b884775090ed88cd1a143f64442a92a6c34eaeff3857976d15ef2e3beee05d7S3VersionKeyA9E03E19", }, ], }, ], }, Object { "Fn::Select": Array [ 1, Object { "Fn::Split": Array [ "||", Object { "Ref": "AssetParameters6b884775090ed88cd1a143f64442a92a6c34eaeff3857976d15ef2e3beee05d7S3VersionKeyA9E03E19", }, ], }, ], }, ], ], }, }, "Type": "AWS::CloudFormation::Stack", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Nested Stacks templates nested/only-nested-stack.json 1`] = ` Object { "Resources": Object { "NestedStack": Object { "DeletionPolicy": "Delete", "Properties": Object { "TemplateURL": "doesnt-matter", }, "Type": "AWS::CloudFormation::Stack", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Nested Stacks templates nested/parent-bad-depends-on.json 1`] = ` Object { "Resources": Object { "ChildStack": Object { "DeletionPolicy": "Delete", "Properties": Object { "TemplateURL": "https://cfn-templates-set.s3.amazonaws.com/child-import-stack.json", }, "Type": "AWS::CloudFormation::Stack", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Nested Stacks templates nested/parent-creation-policy.json 1`] = ` Object { "Resources": Object { "ChildStack": Object { "CreationPolicy": Object {}, "DeletionPolicy": "Delete", "Properties": Object { "Parameters": Object { "MyBucketParameter": "some-magic-bucket-name", }, "TemplateURL": "https://cfn-templates-set.s3.amazonaws.com/grandchild-import-stack.json", }, "Type": "AWS::CloudFormation::Stack", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Nested Stacks templates nested/parent-invalid-condition.json 1`] = ` Object { "Resources": Object { "ChildStack": Object { "DeletionPolicy": "Delete", "Properties": Object { "Parameters": Object { "MyBucketParameter": "some-magic-bucket-name", }, "TemplateURL": "https://cfn-templates-set.s3.amazonaws.com/grandchild-import-stack.json", }, "Type": "AWS::CloudFormation::Stack", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Nested Stacks templates nested/parent-number-in-child-params.yaml 1`] = ` Object { "AWSTemplateFormatVersion": "2010-09-09", "Resources": Object { "NestedStack": Object { "DeletionPolicy": "Delete", "Properties": Object { "Parameters": Object { "Number": 60, }, "TemplateURL": "https://s3.amazonaws.com/masonme-cdk-test/templates/nested-bucket.yaml", }, "Type": "AWS::CloudFormation::Stack", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Nested Stacks templates nested/parent-one-child.json 1`] = ` Object { "Resources": Object { "ChildStack": Object { "DeletionPolicy": "Delete", "Properties": Object { "Parameters": Object { "MyBucketParameter": "some-magic-bucket-name", }, "TemplateURL": "https://cfn-templates-set.s3.amazonaws.com/grandchild-import-stack.json", }, "Type": "AWS::CloudFormation::Stack", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Nested Stacks templates nested/parent-two-children.json 1`] = ` Object { "Resources": Object { "AnotherChildStack": Object { "DeletionPolicy": "Delete", "Properties": Object { "Parameters": Object { "MyBucketParameter": "another-magic-bucket-name", }, "TemplateURL": "https://cfn-templates-set.s3.amazonaws.com/child-import-stack.json", }, "Type": "AWS::CloudFormation::Stack", "UpdateReplacePolicy": "Delete", }, "ChildStack": Object { "DeletionPolicy": "Delete", "Properties": Object { "Parameters": Object { "MyBucketParameter": "some-magic-bucket-name", }, "TemplateURL": "https://cfn-templates-set.s3.amazonaws.com/child-import-stack.json", }, "Type": "AWS::CloudFormation::Stack", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Nested Stacks templates nested/parent-two-parameters.json 1`] = ` Object { "Resources": Object { "ChildStack": Object { "DeletionPolicy": "Delete", "Properties": Object { "Parameters": Object { "FirstParameter": "first-value", "SecondParameter": "second-value", }, "TemplateURL": "https://cfn-templates-set.s3.amazonaws.com/grandchild-import-stack.json", }, "Type": "AWS::CloudFormation::Stack", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Nested Stacks templates nested/parent-update-policy.json 1`] = ` Object { "Resources": Object { "ChildStack": Object { "DeletionPolicy": "Delete", "Properties": Object { "Parameters": Object { "MyBucketParameter": "some-magic-bucket-name", }, "TemplateURL": "https://cfn-templates-set.s3.amazonaws.com/grandchild-import-stack.json", }, "Type": "AWS::CloudFormation::Stack", "UpdatePolicy": Object {}, "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Nested Stacks templates nested/parent-valid-condition.json 1`] = ` Object { "Conditions": Object { "AlwaysFalseCond": Object { "Fn::Equals": Array [ Object { "Ref": "AWS::Region", }, "completely-made-up-region", ], }, }, "Resources": Object { "ChildStack": Object { "DeletionPolicy": "Delete", "Properties": Object { "Parameters": Object { "MyBucketParameter": "some-magic-bucket-name", }, "TemplateURL": "https://cfn-templates-set.s3.amazonaws.com/grandchild-import-stack.json", }, "Type": "AWS::CloudFormation::Stack", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates Nested Stacks templates nested/parent-with-attributes.json 1`] = ` Object { "Parameters": Object { "ArrayParam": Object { "Type": "CommaDelimitedList", }, }, "Resources": Object { "AnotherChildStack": Object { "DeletionPolicy": "Delete", "Properties": Object { "NotificationARNs": Array [ "arn1", ], "TemplateURL": "https://cfn-templates-set.s3.amazonaws.com/child-import-stack.json", "TimeoutInMinutes": 5, }, "Type": "AWS::CloudFormation::Stack", "UpdateReplacePolicy": "Delete", }, "ChildStack": Object { "DeletionPolicy": "Retain", "DependsOn": Array [ "AnotherChildStack", ], "Metadata": Object { "Property1": "Value1", }, "Properties": Object { "NotificationARNs": Object { "Ref": "ArrayParam", }, "TemplateURL": "https://cfn-templates-set.s3.amazonaws.com/child-import-stack.json", "TimeoutInMinutes": Object { "Fn::Select": Array [ 0, Object { "Ref": "ArrayParam", }, ], }, }, "Type": "AWS::CloudFormation::Stack", "UpdateReplacePolicy": "Retain", }, }, } `; exports[`Evaluation Valid templates SAM templates sam/api-endpoint-config-object.yaml 1`] = ` Object { "AWSTemplateFormatVersion": "2010-09-09", "Resources": Object { "Api": Object { "DeletionPolicy": "Delete", "Properties": Object { "DefinitionBody": Object { "Body": "DefinitionBody", }, "EndpointConfiguration": Object { "Type": "GLOBAL", }, "StageName": "prod", }, "Type": "AWS::Serverless::Api", "UpdateReplacePolicy": "Delete", }, }, "Transform": "AWS::Serverless-2016-10-31", } `; exports[`Evaluation Valid templates SAM templates sam/api-endpoint-config-string.yaml 1`] = ` Object { "AWSTemplateFormatVersion": "2010-09-09", "Resources": Object { "Api": Object { "DeletionPolicy": "Delete", "Properties": Object { "DefinitionBody": Object { "Body": "DefinitionBody", }, "EndpointConfiguration": "GLOBAL", "StageName": "prod", }, "Type": "AWS::Serverless::Api", "UpdateReplacePolicy": "Delete", }, }, "Transform": "AWS::Serverless-2016-10-31", } `; exports[`Evaluation Valid templates SAM templates sam/api-endpoint-config-string-empty.yaml 1`] = ` Object { "AWSTemplateFormatVersion": "2010-09-09", "Resources": Object { "Api": Object { "DeletionPolicy": "Delete", "Properties": Object { "DefinitionBody": Object { "Body": "DefinitionBody", }, "EndpointConfiguration": "", "StageName": "prod", }, "Type": "AWS::Serverless::Api", "UpdateReplacePolicy": "Delete", }, }, "Transform": "AWS::Serverless-2016-10-31", } `; exports[`Evaluation Valid templates SAM templates sam/only-minimal-sam-function-codeuri-as-param.yaml 1`] = ` Object { "AWSTemplateFormatVersion": "2010-09-09", "Parameters": Object { "CodeLocation": Object { "Type": "String", }, }, "Resources": Object { "MicroserviceHttpEndpoint": Object { "DeletionPolicy": "Delete", "Properties": Object { "CodeUri": Object { "Ref": "CodeLocation", }, "Handler": "index.handler", "Runtime": "nodejs12.x", }, "Type": "AWS::Serverless::Function", "UpdateReplacePolicy": "Delete", }, }, "Transform": "AWS::Serverless-2016-10-31", } `; exports[`Evaluation Valid templates SAM templates sam/only-minimal-sam-function-codeuri-as-s3location.yaml 1`] = ` Object { "AWSTemplateFormatVersion": "2010-09-09", "Resources": Object { "MicroserviceHttpEndpoint": Object { "DeletionPolicy": "Delete", "Properties": Object { "CodeUri": Object { "Bucket": "awsserverlessrepo-changesets-1f9ifp952i9h0", "Key": "123456789012/arn:aws:serverlessrepo:us-east-1:077246666028:applications-microservice-http-endpoint-versions-1.0.4/dc38a8c1-d27f-44f3-b545-4cfff4f8b865", }, "Handler": "index.handler", "Runtime": "nodejs12.x", }, "Type": "AWS::Serverless::Function", "UpdateReplacePolicy": "Delete", }, }, "Transform": "AWS::Serverless-2016-10-31", } `; exports[`Evaluation Valid templates SAM templates sam/only-minimal-sam-function-codeuri-bucket-as-param.yaml 1`] = ` Object { "AWSTemplateFormatVersion": "2010-09-09", "Parameters": Object { "CodeLocation": Object { "Type": "String", }, }, "Resources": Object { "MicroserviceHttpEndpoint": Object { "DeletionPolicy": "Delete", "Properties": Object { "CodeUri": Object { "Bucket": Object { "Ref": "CodeLocation", }, "Key": "my-key", }, "Handler": "index.handler", "Runtime": "nodejs12.x", }, "Type": "AWS::Serverless::Function", "UpdateReplacePolicy": "Delete", }, }, "Transform": "AWS::Serverless-2016-10-31", } `; exports[`Evaluation Valid templates SAM templates sam/only-sam-function-policies-array-ddb-crud.yaml 1`] = ` Object { "AWSTemplateFormatVersion": "2010-09-09", "Parameters": Object { "TableNameParameter": Object { "Type": "String", }, }, "Resources": Object { "MicroserviceHttpEndpoint": Object { "DeletionPolicy": "Delete", "Properties": Object { "CodeUri": "my-code-uri", "Handler": "index.handler", "Policies": Array [ Object { "DynamoDBCrudPolicy": Object { "TableName": Object { "Ref": "TableNameParameter", }, }, }, ], "Runtime": "nodejs12.x", }, "Type": "AWS::Serverless::Function", "UpdateReplacePolicy": "Delete", }, }, "Transform": "AWS::Serverless-2016-10-31", } `; exports[`Evaluation Valid templates SAM templates sam/only-sam-function-policies-array-ddb-crud-if.yaml 1`] = ` Object { "AWSTemplateFormatVersion": "2010-09-09", "Conditions": Object { "SomeCondition": Object { "Fn::Equals": Array [ 1, 2, ], }, }, "Parameters": Object { "TableNameParameter": Object { "Type": "String", }, }, "Resources": Object { "MicroserviceHttpEndpoint": Object { "DeletionPolicy": "Delete", "Properties": Object { "CodeUri": Object { "Bucket": "awsserverlessrepo-changesets-1f9ifp952i9h0", "Key": "828671620168/arn:aws:serverlessrepo:us-east-1:077246666028:applications-microservice-http-endpoint-versions-1.0.4/dc38a8c1-d27f-44f3-b545-4cfff4f8b865", }, "Handler": "index.handler", "Policies": Array [ Object { "Fn::If": Array [ "SomeCondition", Object { "DynamoDBCrudPolicy": Object { "TableName": Object { "Ref": "TableNameParameter", }, }, }, Object { "DynamoDBCrudPolicy": Object { "TableName": Object { "Ref": "TableNameParameter", }, }, }, ], }, ], "Runtime": "nodejs12.x", }, "Type": "AWS::Serverless::Function", "UpdateReplacePolicy": "Delete", }, }, "Transform": "AWS::Serverless-2016-10-31", } `; exports[`Evaluation Valid templates examples/apigw.json 1`] = ` Object { "AWSTemplateFormatVersion": "2010-09-09", "Description": "A template creates a lambda function with an api gateway", "Outputs": Object { "MyApiEndpoint869ABE96": Object { "Value": Object { "Fn::Join": Array [ "", Array [ "https://", Object { "Ref": "MyApi49610EDF", }, ".execute-api.", Object { "Ref": "AWS::Region", }, ".", Object { "Ref": "AWS::URLSuffix", }, "/", Object { "Ref": "MyApiDeploymentStageprodE1054AF0", }, "/", ], ], }, }, }, "Resources": Object { "GetRootA9424890": Object { "Properties": Object { "AuthorizationType": "NONE", "HttpMethod": "GET", "Integration": Object { "IntegrationHttpMethod": "POST", "Type": "AWS_PROXY", "Uri": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":apigateway:", Object { "Ref": "AWS::Region", }, ":lambda:path/2015-03-31/functions/", Object { "Fn::GetAtt": Array [ "HelloLambda3D9C82D6", "Arn", ], }, "/invocations", ], ], }, }, "ResourceId": Object { "Fn::GetAtt": Array [ "MyApi49610EDF", "RootResourceId", ], }, "RestApiId": Object { "Ref": "MyApi49610EDF", }, }, "Type": "AWS::ApiGateway::Method", }, "GetRootApiPermissionTestMyApi8B2BE17AGET60A859EA": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloLambda3D9C82D6", "Arn", ], }, "Principal": "apigateway.amazonaws.com", "SourceArn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":execute-api:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "MyApi49610EDF", }, "/", Object { "Ref": "MyApiDeploymentStageprodE1054AF0", }, "/GET/", ], ], }, }, "Type": "AWS::Lambda::Permission", }, "GetRootApiPermissionTestTestMyApi8B2BE17AGETD0B1F4C3": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloLambda3D9C82D6", "Arn", ], }, "Principal": "apigateway.amazonaws.com", "SourceArn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":execute-api:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "MyApi49610EDF", }, "/test-invoke-stage/GET/", ], ], }, }, "Type": "AWS::Lambda::Permission", }, "HelloLambda3D9C82D6": Object { "DependsOn": Array [ "HelloLambdaServiceRoleE071F162", ], "Properties": Object { "Code": Object { "S3Bucket": Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "41b1de375e679030ee7361874b689e99ab0657e9d274a8e6193d1513940a0c2f.zip", }, "Handler": "index.handler", "Role": Object { "Fn::GetAtt": Array [ "HelloLambdaServiceRoleE071F162", "Arn", ], }, "Runtime": "python3.6", "Tags": Array [ Object { "Key": "category", "Value": "ecommerce", }, ], }, "Type": "AWS::Lambda::Function", }, "HelloLambdaServiceRoleE071F162": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], "Tags": Array [ Object { "Key": "category", "Value": "ecommerce", }, ], }, "Type": "AWS::IAM::Role", }, "MyApi49610EDF": Object { "Properties": Object { "Name": "MyApi", }, "Type": "AWS::ApiGateway::RestApi", }, "MyApiANYApiPermissionTestMyApi8B2BE17AANY689FE066": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloLambda3D9C82D6", "Arn", ], }, "Principal": "apigateway.amazonaws.com", "SourceArn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":execute-api:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "MyApi49610EDF", }, "/", Object { "Ref": "MyApiDeploymentStageprodE1054AF0", }, "/*/", ], ], }, }, "Type": "AWS::Lambda::Permission", }, "MyApiANYApiPermissionTestTestMyApi8B2BE17AANYE4477AC0": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloLambda3D9C82D6", "Arn", ], }, "Principal": "apigateway.amazonaws.com", "SourceArn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":execute-api:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "MyApi49610EDF", }, "/test-invoke-stage/*/", ], ], }, }, "Type": "AWS::Lambda::Permission", }, "MyApiANYEC3618D9": Object { "Properties": Object { "AuthorizationType": "NONE", "HttpMethod": "ANY", "Integration": Object { "IntegrationHttpMethod": "POST", "Type": "AWS_PROXY", "Uri": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":apigateway:", Object { "Ref": "AWS::Region", }, ":lambda:path/2015-03-31/functions/", Object { "Fn::GetAtt": Array [ "HelloLambda3D9C82D6", "Arn", ], }, "/invocations", ], ], }, }, "ResourceId": Object { "Fn::GetAtt": Array [ "MyApi49610EDF", "RootResourceId", ], }, "RestApiId": Object { "Ref": "MyApi49610EDF", }, }, "Type": "AWS::ApiGateway::Method", }, "MyApiAccount13882D84": Object { "DeletionPolicy": "Retain", "DependsOn": Array [ "MyApi49610EDF", ], "Properties": Object { "CloudWatchRoleArn": Object { "Fn::GetAtt": Array [ "MyApiCloudWatchRole2BEC1A9C", "Arn", ], }, }, "Type": "AWS::ApiGateway::Account", "UpdateReplacePolicy": "Retain", }, "MyApiCloudWatchRole2BEC1A9C": Object { "DeletionPolicy": "Retain", "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "apigateway.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs", ], ], }, ], }, "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, "MyApiDeploymentECB0D05E0597cc4592870e54c401cccc6090bd86": Object { "DependsOn": Array [ "GetRootA9424890", "MyApiproxyANYFCF46C66", "MyApiproxyE14DBEA4", "MyApiANYEC3618D9", ], "Properties": Object { "Description": "Automatically created by the RestApi construct", "RestApiId": Object { "Ref": "MyApi49610EDF", }, }, "Type": "AWS::ApiGateway::Deployment", }, "MyApiDeploymentStageprodE1054AF0": Object { "DependsOn": Array [ "MyApiAccount13882D84", ], "Properties": Object { "DeploymentId": Object { "Ref": "MyApiDeploymentECB0D05E0597cc4592870e54c401cccc6090bd86", }, "RestApiId": Object { "Ref": "MyApi49610EDF", }, "StageName": "prod", }, "Type": "AWS::ApiGateway::Stage", }, "MyApiproxyANYApiPermissionTestMyApi8B2BE17AANYproxyD8FBCB14": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloLambda3D9C82D6", "Arn", ], }, "Principal": "apigateway.amazonaws.com", "SourceArn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":execute-api:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "MyApi49610EDF", }, "/", Object { "Ref": "MyApiDeploymentStageprodE1054AF0", }, "/*/*", ], ], }, }, "Type": "AWS::Lambda::Permission", }, "MyApiproxyANYApiPermissionTestTestMyApi8B2BE17AANYproxy4A6D235F": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloLambda3D9C82D6", "Arn", ], }, "Principal": "apigateway.amazonaws.com", "SourceArn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":execute-api:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "MyApi49610EDF", }, "/test-invoke-stage/*/*", ], ], }, }, "Type": "AWS::Lambda::Permission", }, "MyApiproxyANYFCF46C66": Object { "Properties": Object { "AuthorizationType": "NONE", "HttpMethod": "ANY", "Integration": Object { "IntegrationHttpMethod": "POST", "Type": "AWS_PROXY", "Uri": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":apigateway:", Object { "Ref": "AWS::Region", }, ":lambda:path/2015-03-31/functions/", Object { "Fn::GetAtt": Array [ "HelloLambda3D9C82D6", "Arn", ], }, "/invocations", ], ], }, }, "ResourceId": Object { "Ref": "MyApiproxyE14DBEA4", }, "RestApiId": Object { "Ref": "MyApi49610EDF", }, }, "Type": "AWS::ApiGateway::Method", }, "MyApiproxyE14DBEA4": Object { "Properties": Object { "ParentId": Object { "Fn::GetAtt": Array [ "MyApi49610EDF", "RootResourceId", ], }, "PathPart": "{proxy+}", "RestApiId": Object { "Ref": "MyApi49610EDF", }, }, "Type": "AWS::ApiGateway::Resource", }, }, } `; exports[`Evaluation Valid templates examples/application-load-balancer.yaml 1`] = ` Object { "Parameters": Object { "SsmParameterValueawsserviceamiamazonlinuxlatestamznamihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter": Object { "Default": "/aws/service/ami-amazon-linux-latest/amzn-ami-hvm-x86_64-gp2", "Type": "AWS::SSM::Parameter::Value", }, }, "Resources": Object { "ASG46ED3070": Object { "Properties": Object { "LaunchConfigurationName": Object { "Ref": "ASGLaunchConfigC00AF12B", }, "MaxSize": "1", "MinSize": "1", "Tags": Array [ Object { "Key": "Name", "PropagateAtLaunch": true, "Value": "Test/ASG", }, ], "TargetGroupARNs": Array [ Object { "Ref": "LBListenerTargetGroupF04FCF6D", }, ], "VPCZoneIdentifier": Array [ Object { "Ref": "VPCPrivateSubnet1Subnet8BCA10E0", }, Object { "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A", }, ], }, "Type": "AWS::AutoScaling::AutoScalingGroup", "UpdatePolicy": Object { "AutoScalingScheduledAction": Object { "IgnoreUnmodifiedGroupSizeProperties": true, }, }, }, "ASGInstanceProfile0A2834D7": Object { "Properties": Object { "Roles": Array [ Object { "Ref": "ASGInstanceRoleE263A41B", }, ], }, "Type": "AWS::IAM::InstanceProfile", }, "ASGInstanceRoleE263A41B": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "ec2.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "Tags": Array [ Object { "Key": "Name", "Value": "Test/ASG", }, ], }, "Type": "AWS::IAM::Role", }, "ASGInstanceSecurityGroup0525485D": Object { "Properties": Object { "GroupDescription": "Test/ASG/InstanceSecurityGroup", "SecurityGroupEgress": Array [ Object { "CidrIp": "0.0.0.0/0", "Description": "Allow all outbound traffic by default", "IpProtocol": "-1", }, ], "Tags": Array [ Object { "Key": "Name", "Value": "Test/ASG", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::SecurityGroup", }, "ASGInstanceSecurityGroupfromTestLBSecurityGroup4B06E83F80AAE76093": Object { "Properties": Object { "Description": "Load balancer to target", "FromPort": 80, "GroupId": Object { "Fn::GetAtt": Array [ "ASGInstanceSecurityGroup0525485D", "GroupId", ], }, "IpProtocol": "tcp", "SourceSecurityGroupId": Object { "Fn::GetAtt": Array [ "LBSecurityGroup8A41EA2B", "GroupId", ], }, "ToPort": 80, }, "Type": "AWS::EC2::SecurityGroupIngress", }, "ASGLaunchConfigC00AF12B": Object { "DependsOn": Array [ "ASGInstanceRoleE263A41B", ], "Properties": Object { "IamInstanceProfile": Object { "Ref": "ASGInstanceProfile0A2834D7", }, "ImageId": Object { "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestamznamihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter", }, "InstanceType": "t2.micro", "SecurityGroups": Array [ Object { "Fn::GetAtt": Array [ "ASGInstanceSecurityGroup0525485D", "GroupId", ], }, ], "UserData": Object { "Fn::Base64": "#!/bin/bash", }, }, "Type": "AWS::AutoScaling::LaunchConfiguration", }, "ASGScalingPolicyAModestLoadC5714E5A": Object { "DependsOn": Array [ "LBListener49E825B4", "LBListenerTargetGroupF04FCF6D", ], "Properties": Object { "AutoScalingGroupName": Object { "Ref": "ASG46ED3070", }, "PolicyType": "TargetTrackingScaling", "TargetTrackingConfiguration": Object { "PredefinedMetricSpecification": Object { "PredefinedMetricType": "ALBRequestCountPerTarget", "ResourceLabel": Object { "Fn::Join": Array [ "", Array [ Object { "Fn::Select": Array [ 1, Object { "Fn::Split": Array [ "/", Object { "Ref": "LBListener49E825B4", }, ], }, ], }, "/", Object { "Fn::Select": Array [ 2, Object { "Fn::Split": Array [ "/", Object { "Ref": "LBListener49E825B4", }, ], }, ], }, "/", Object { "Fn::Select": Array [ 3, Object { "Fn::Split": Array [ "/", Object { "Ref": "LBListener49E825B4", }, ], }, ], }, "/", Object { "Fn::GetAtt": Array [ "LBListenerTargetGroupF04FCF6D", "TargetGroupFullName", ], }, ], ], }, }, "TargetValue": 60, }, }, "Type": "AWS::AutoScaling::ScalingPolicy", }, "LB8A12904C": Object { "DependsOn": Array [ "VPCPublicSubnet1DefaultRoute91CEF279", "VPCPublicSubnet1RouteTableAssociation0B0896DC", "VPCPublicSubnet2DefaultRouteB7481BBA", "VPCPublicSubnet2RouteTableAssociation5A808732", ], "Properties": Object { "LoadBalancerAttributes": Array [ Object { "Key": "deletion_protection.enabled", "Value": "false", }, ], "Scheme": "internet-facing", "SecurityGroups": Array [ Object { "Fn::GetAtt": Array [ "LBSecurityGroup8A41EA2B", "GroupId", ], }, ], "Subnets": Array [ Object { "Ref": "VPCPublicSubnet1SubnetB4246D30", }, Object { "Ref": "VPCPublicSubnet2Subnet74179F39", }, ], "Type": "application", }, "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", }, "LBListener49E825B4": Object { "Properties": Object { "DefaultActions": Array [ Object { "TargetGroupArn": Object { "Ref": "LBListenerTargetGroupF04FCF6D", }, "Type": "forward", }, ], "LoadBalancerArn": Object { "Ref": "LB8A12904C", }, "Port": 80, "Protocol": "HTTP", }, "Type": "AWS::ElasticLoadBalancingV2::Listener", }, "LBListenerTargetGroupF04FCF6D": Object { "Properties": Object { "Port": 80, "Protocol": "HTTP", "TargetGroupAttributes": Array [ Object { "Key": "stickiness.enabled", "Value": "false", }, ], "TargetType": "instance", "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", }, "LBSecurityGroup8A41EA2B": Object { "Properties": Object { "GroupDescription": "Automatically created Security Group for ELB TestLB2A36A136", "SecurityGroupIngress": Array [ Object { "CidrIp": "0.0.0.0/0", "Description": "Allow from anyone on port 80", "FromPort": 80, "IpProtocol": "tcp", "ToPort": 80, }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::SecurityGroup", }, "LBSecurityGrouptoTestASGInstanceSecurityGroup3AFA1BF6801A718671": Object { "Properties": Object { "Description": "Load balancer to target", "DestinationSecurityGroupId": Object { "Fn::GetAtt": Array [ "ASGInstanceSecurityGroup0525485D", "GroupId", ], }, "FromPort": 80, "GroupId": Object { "Fn::GetAtt": Array [ "LBSecurityGroup8A41EA2B", "GroupId", ], }, "IpProtocol": "tcp", "ToPort": 80, }, "Type": "AWS::EC2::SecurityGroupEgress", }, "VPCB9E5F0B4": Object { "Properties": Object { "CidrBlock": "10.0.0.0/16", "EnableDnsHostnames": true, "EnableDnsSupport": true, "InstanceTenancy": "default", "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC", }, ], }, "Type": "AWS::EC2::VPC", }, "VPCIGWB7E252D3": Object { "Properties": Object { "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC", }, ], }, "Type": "AWS::EC2::InternetGateway", }, "VPCPrivateSubnet1DefaultRouteAE1D6490": Object { "Properties": Object { "DestinationCidrBlock": "0.0.0.0/0", "NatGatewayId": Object { "Ref": "VPCPublicSubnet1NATGatewayE0556630", }, "RouteTableId": Object { "Ref": "VPCPrivateSubnet1RouteTableBE8A6027", }, }, "Type": "AWS::EC2::Route", }, "VPCPrivateSubnet1RouteTableAssociation347902D1": Object { "Properties": Object { "RouteTableId": Object { "Ref": "VPCPrivateSubnet1RouteTableBE8A6027", }, "SubnetId": Object { "Ref": "VPCPrivateSubnet1Subnet8BCA10E0", }, }, "Type": "AWS::EC2::SubnetRouteTableAssociation", }, "VPCPrivateSubnet1RouteTableBE8A6027": Object { "Properties": Object { "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC/PrivateSubnet1", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::RouteTable", }, "VPCPrivateSubnet1Subnet8BCA10E0": Object { "Properties": Object { "AvailabilityZone": Object { "Fn::Select": Array [ 0, Object { "Fn::GetAZs": "", }, ], }, "CidrBlock": "10.0.128.0/18", "MapPublicIpOnLaunch": false, "Tags": Array [ Object { "Key": "aws-cdk:subnet-name", "Value": "Private", }, Object { "Key": "aws-cdk:subnet-type", "Value": "Private", }, Object { "Key": "Name", "Value": "Test/VPC/PrivateSubnet1", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::Subnet", }, "VPCPrivateSubnet2DefaultRouteF4F5CFD2": Object { "Properties": Object { "DestinationCidrBlock": "0.0.0.0/0", "NatGatewayId": Object { "Ref": "VPCPublicSubnet2NATGateway3C070193", }, "RouteTableId": Object { "Ref": "VPCPrivateSubnet2RouteTable0A19E10E", }, }, "Type": "AWS::EC2::Route", }, "VPCPrivateSubnet2RouteTable0A19E10E": Object { "Properties": Object { "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC/PrivateSubnet2", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::RouteTable", }, "VPCPrivateSubnet2RouteTableAssociation0C73D413": Object { "Properties": Object { "RouteTableId": Object { "Ref": "VPCPrivateSubnet2RouteTable0A19E10E", }, "SubnetId": Object { "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A", }, }, "Type": "AWS::EC2::SubnetRouteTableAssociation", }, "VPCPrivateSubnet2SubnetCFCDAA7A": Object { "Properties": Object { "AvailabilityZone": Object { "Fn::Select": Array [ 1, Object { "Fn::GetAZs": "", }, ], }, "CidrBlock": "10.0.192.0/18", "MapPublicIpOnLaunch": false, "Tags": Array [ Object { "Key": "aws-cdk:subnet-name", "Value": "Private", }, Object { "Key": "aws-cdk:subnet-type", "Value": "Private", }, Object { "Key": "Name", "Value": "Test/VPC/PrivateSubnet2", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::Subnet", }, "VPCPublicSubnet1DefaultRoute91CEF279": Object { "DependsOn": Array [ "VPCVPCGW99B986DC", ], "Properties": Object { "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": Object { "Ref": "VPCIGWB7E252D3", }, "RouteTableId": Object { "Ref": "VPCPublicSubnet1RouteTableFEE4B781", }, }, "Type": "AWS::EC2::Route", }, "VPCPublicSubnet1EIP6AD938E8": Object { "Properties": Object { "Domain": "vpc", "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC/PublicSubnet1", }, ], }, "Type": "AWS::EC2::EIP", }, "VPCPublicSubnet1NATGatewayE0556630": Object { "DependsOn": Array [ "VPCPublicSubnet1DefaultRoute91CEF279", "VPCPublicSubnet1RouteTableAssociation0B0896DC", ], "Properties": Object { "AllocationId": Object { "Fn::GetAtt": Array [ "VPCPublicSubnet1EIP6AD938E8", "AllocationId", ], }, "SubnetId": Object { "Ref": "VPCPublicSubnet1SubnetB4246D30", }, "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC/PublicSubnet1", }, ], }, "Type": "AWS::EC2::NatGateway", }, "VPCPublicSubnet1RouteTableAssociation0B0896DC": Object { "Properties": Object { "RouteTableId": Object { "Ref": "VPCPublicSubnet1RouteTableFEE4B781", }, "SubnetId": Object { "Ref": "VPCPublicSubnet1SubnetB4246D30", }, }, "Type": "AWS::EC2::SubnetRouteTableAssociation", }, "VPCPublicSubnet1RouteTableFEE4B781": Object { "Properties": Object { "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC/PublicSubnet1", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::RouteTable", }, "VPCPublicSubnet1SubnetB4246D30": Object { "Properties": Object { "AvailabilityZone": Object { "Fn::Select": Array [ 0, Object { "Fn::GetAZs": "", }, ], }, "CidrBlock": "10.0.0.0/18", "MapPublicIpOnLaunch": true, "Tags": Array [ Object { "Key": "aws-cdk:subnet-name", "Value": "Public", }, Object { "Key": "aws-cdk:subnet-type", "Value": "Public", }, Object { "Key": "Name", "Value": "Test/VPC/PublicSubnet1", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::Subnet", }, "VPCPublicSubnet2DefaultRouteB7481BBA": Object { "DependsOn": Array [ "VPCVPCGW99B986DC", ], "Properties": Object { "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": Object { "Ref": "VPCIGWB7E252D3", }, "RouteTableId": Object { "Ref": "VPCPublicSubnet2RouteTable6F1A15F1", }, }, "Type": "AWS::EC2::Route", }, "VPCPublicSubnet2EIP4947BC00": Object { "Properties": Object { "Domain": "vpc", "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC/PublicSubnet2", }, ], }, "Type": "AWS::EC2::EIP", }, "VPCPublicSubnet2NATGateway3C070193": Object { "DependsOn": Array [ "VPCPublicSubnet2DefaultRouteB7481BBA", "VPCPublicSubnet2RouteTableAssociation5A808732", ], "Properties": Object { "AllocationId": Object { "Fn::GetAtt": Array [ "VPCPublicSubnet2EIP4947BC00", "AllocationId", ], }, "SubnetId": Object { "Ref": "VPCPublicSubnet2Subnet74179F39", }, "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC/PublicSubnet2", }, ], }, "Type": "AWS::EC2::NatGateway", }, "VPCPublicSubnet2RouteTable6F1A15F1": Object { "Properties": Object { "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC/PublicSubnet2", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::RouteTable", }, "VPCPublicSubnet2RouteTableAssociation5A808732": Object { "Properties": Object { "RouteTableId": Object { "Ref": "VPCPublicSubnet2RouteTable6F1A15F1", }, "SubnetId": Object { "Ref": "VPCPublicSubnet2Subnet74179F39", }, }, "Type": "AWS::EC2::SubnetRouteTableAssociation", }, "VPCPublicSubnet2Subnet74179F39": Object { "Properties": Object { "AvailabilityZone": Object { "Fn::Select": Array [ 1, Object { "Fn::GetAZs": "", }, ], }, "CidrBlock": "10.0.64.0/18", "MapPublicIpOnLaunch": true, "Tags": Array [ Object { "Key": "aws-cdk:subnet-name", "Value": "Public", }, Object { "Key": "aws-cdk:subnet-type", "Value": "Public", }, Object { "Key": "Name", "Value": "Test/VPC/PublicSubnet2", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::Subnet", }, "VPCVPCGW99B986DC": Object { "Properties": Object { "InternetGatewayId": Object { "Ref": "VPCIGWB7E252D3", }, "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::VPCGatewayAttachment", }, }, } `; exports[`Evaluation Valid templates examples/ecs.json 1`] = ` Object { "AWSTemplateFormatVersion": "2010-09-09", "Description": "A template creates a Fargate service with necessary resources", "Resources": Object { "ClusterEB0386A7": Object { "Type": "AWS::ECS::Cluster", }, "MyTaskDef01F0D39B": Object { "Properties": Object { "ContainerDefinitions": Array [ Object { "Essential": true, "Image": "redis", "Memory": 1024, "Name": "ContainerDef", }, ], "Cpu": "1024", "Family": "redis", "Memory": "1GB", "NetworkMode": "awsvpc", "RequiresCompatibilities": Array [ "FARGATE", ], "TaskRoleArn": Object { "Fn::GetAtt": Array [ "MyTaskDefTaskRole727F9D3B", "Arn", ], }, }, "Type": "AWS::ECS::TaskDefinition", }, "MyTaskDefTaskRole727F9D3B": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "ecs-tasks.amazonaws.com", }, }, ], "Version": "2012-10-17", }, }, "Type": "AWS::IAM::Role", }, "ServiceD69D759B": Object { "DependsOn": Array [ "MyTaskDefTaskRole727F9D3B", ], "Properties": Object { "Cluster": Object { "Ref": "ClusterEB0386A7", }, "DeploymentConfiguration": Object { "Alarms": Object { "AlarmNames": Array [], "Enable": false, "Rollback": false, }, "MaximumPercent": 200, "MinimumHealthyPercent": 50, }, "EnableECSManagedTags": false, "LaunchType": "FARGATE", "NetworkConfiguration": Object { "AwsvpcConfiguration": Object { "AssignPublicIp": "DISABLED", "SecurityGroups": Array [ Object { "Fn::GetAtt": Array [ "ServiceSecurityGroupC96ED6A7", "GroupId", ], }, ], "Subnets": Array [ Object { "Ref": "VPCPrivateSubnet1Subnet8BCA10E0", }, ], }, }, "TaskDefinition": Object { "Ref": "MyTaskDef01F0D39B", }, }, "Type": "AWS::ECS::Service", }, "ServiceSecurityGroupC96ED6A7": Object { "DependsOn": Array [ "MyTaskDefTaskRole727F9D3B", ], "Properties": Object { "GroupDescription": "Test/Service/SecurityGroup", "SecurityGroupEgress": Array [ Object { "CidrIp": "0.0.0.0/0", "Description": "Allow all outbound traffic by default", "IpProtocol": "-1", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::SecurityGroup", }, "VPCB9E5F0B4": Object { "Properties": Object { "CidrBlock": "10.0.0.0/16", "EnableDnsHostnames": true, "EnableDnsSupport": true, "InstanceTenancy": "default", "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC", }, ], }, "Type": "AWS::EC2::VPC", }, "VPCIGWB7E252D3": Object { "Properties": Object { "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC", }, ], }, "Type": "AWS::EC2::InternetGateway", }, "VPCPrivateSubnet1DefaultRouteAE1D6490": Object { "Properties": Object { "DestinationCidrBlock": "0.0.0.0/0", "NatGatewayId": Object { "Ref": "VPCPublicSubnet1NATGatewayE0556630", }, "RouteTableId": Object { "Ref": "VPCPrivateSubnet1RouteTableBE8A6027", }, }, "Type": "AWS::EC2::Route", }, "VPCPrivateSubnet1RouteTableAssociation347902D1": Object { "Properties": Object { "RouteTableId": Object { "Ref": "VPCPrivateSubnet1RouteTableBE8A6027", }, "SubnetId": Object { "Ref": "VPCPrivateSubnet1Subnet8BCA10E0", }, }, "Type": "AWS::EC2::SubnetRouteTableAssociation", }, "VPCPrivateSubnet1RouteTableBE8A6027": Object { "Properties": Object { "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC/PrivateSubnet1", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::RouteTable", }, "VPCPrivateSubnet1Subnet8BCA10E0": Object { "Properties": Object { "AvailabilityZone": Object { "Fn::Select": Array [ 0, Object { "Fn::GetAZs": "", }, ], }, "CidrBlock": "10.0.128.0/17", "MapPublicIpOnLaunch": false, "Tags": Array [ Object { "Key": "aws-cdk:subnet-name", "Value": "Private", }, Object { "Key": "aws-cdk:subnet-type", "Value": "Private", }, Object { "Key": "Name", "Value": "Test/VPC/PrivateSubnet1", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::Subnet", }, "VPCPublicSubnet1DefaultRoute91CEF279": Object { "DependsOn": Array [ "VPCVPCGW99B986DC", ], "Properties": Object { "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": Object { "Ref": "VPCIGWB7E252D3", }, "RouteTableId": Object { "Ref": "VPCPublicSubnet1RouteTableFEE4B781", }, }, "Type": "AWS::EC2::Route", }, "VPCPublicSubnet1EIP6AD938E8": Object { "Properties": Object { "Domain": "vpc", "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC/PublicSubnet1", }, ], }, "Type": "AWS::EC2::EIP", }, "VPCPublicSubnet1NATGatewayE0556630": Object { "DependsOn": Array [ "VPCPublicSubnet1DefaultRoute91CEF279", "VPCPublicSubnet1RouteTableAssociation0B0896DC", ], "Properties": Object { "AllocationId": Object { "Fn::GetAtt": Array [ "VPCPublicSubnet1EIP6AD938E8", "AllocationId", ], }, "SubnetId": Object { "Ref": "VPCPublicSubnet1SubnetB4246D30", }, "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC/PublicSubnet1", }, ], }, "Type": "AWS::EC2::NatGateway", }, "VPCPublicSubnet1RouteTableAssociation0B0896DC": Object { "Properties": Object { "RouteTableId": Object { "Ref": "VPCPublicSubnet1RouteTableFEE4B781", }, "SubnetId": Object { "Ref": "VPCPublicSubnet1SubnetB4246D30", }, }, "Type": "AWS::EC2::SubnetRouteTableAssociation", }, "VPCPublicSubnet1RouteTableFEE4B781": Object { "Properties": Object { "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC/PublicSubnet1", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::RouteTable", }, "VPCPublicSubnet1SubnetB4246D30": Object { "Properties": Object { "AvailabilityZone": Object { "Fn::Select": Array [ 0, Object { "Fn::GetAZs": "", }, ], }, "CidrBlock": "10.0.0.0/17", "MapPublicIpOnLaunch": true, "Tags": Array [ Object { "Key": "aws-cdk:subnet-name", "Value": "Public", }, Object { "Key": "aws-cdk:subnet-type", "Value": "Public", }, Object { "Key": "Name", "Value": "Test/VPC/PublicSubnet1", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::Subnet", }, "VPCVPCGW99B986DC": Object { "Properties": Object { "InternetGatewayId": Object { "Ref": "VPCIGWB7E252D3", }, "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::VPCGatewayAttachment", }, }, } `; exports[`Evaluation Valid templates examples/fleet.json 1`] = ` Object { "Description": "A template creates an ASG and Vpc", "Parameters": Object { "SsmParameterValueawsserviceecsoptimizedamiamazonlinux2recommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter": Object { "Default": "/aws/service/ecs/optimized-ami/amazon-linux-2/recommended/image_id", "Type": "AWS::SSM::Parameter::Value", }, }, "Resources": Object { "MyFleetASG88E55886": Object { "Properties": Object { "DesiredCapacity": "3", "LaunchConfigurationName": Object { "Ref": "MyFleetLaunchConfig5D7F9801", }, "MaxSize": "3", "MinSize": "1", "Tags": Array [ Object { "Key": "Name", "PropagateAtLaunch": true, "Value": "Test/MyFleet", }, ], "VPCZoneIdentifier": Array [ Object { "Ref": "MyVpcPrivateSubnet1Subnet5057CF7E", }, Object { "Ref": "MyVpcPrivateSubnet2Subnet0040C983", }, ], }, "Type": "AWS::AutoScaling::AutoScalingGroup", "UpdatePolicy": Object { "AutoScalingScheduledAction": Object { "IgnoreUnmodifiedGroupSizeProperties": true, }, }, }, "MyFleetInstanceProfile70A58496": Object { "Properties": Object { "Roles": Array [ Object { "Ref": "MyFleetInstanceRole25A84AB8", }, ], }, "Type": "AWS::IAM::InstanceProfile", }, "MyFleetInstanceRole25A84AB8": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "ec2.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "Tags": Array [ Object { "Key": "Name", "Value": "Test/MyFleet", }, ], }, "Type": "AWS::IAM::Role", }, "MyFleetInstanceSecurityGroup774E8234": Object { "Properties": Object { "GroupDescription": "Test/MyFleet/InstanceSecurityGroup", "SecurityGroupEgress": Array [ Object { "CidrIp": "0.0.0.0/0", "Description": "Allow all outbound traffic by default", "IpProtocol": "-1", }, ], "Tags": Array [ Object { "Key": "Name", "Value": "Test/MyFleet", }, ], "VpcId": Object { "Ref": "MyVpcF9F0CA6F", }, }, "Type": "AWS::EC2::SecurityGroup", }, "MyFleetLaunchConfig5D7F9801": Object { "DependsOn": Array [ "MyFleetInstanceRole25A84AB8", ], "Properties": Object { "IamInstanceProfile": Object { "Ref": "MyFleetInstanceProfile70A58496", }, "ImageId": Object { "Ref": "SsmParameterValueawsserviceecsoptimizedamiamazonlinux2recommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter", }, "InstanceType": "t2.xlarge", "SecurityGroups": Array [ Object { "Fn::GetAtt": Array [ "MyFleetInstanceSecurityGroup774E8234", "GroupId", ], }, ], "UserData": Object { "Fn::Base64": "#!/bin/bash", }, }, "Type": "AWS::AutoScaling::LaunchConfiguration", }, "MyVpcF9F0CA6F": Object { "Properties": Object { "CidrBlock": "10.0.0.0/16", "EnableDnsHostnames": true, "EnableDnsSupport": true, "InstanceTenancy": "default", "Tags": Array [ Object { "Key": "Name", "Value": "Test/MyVpc", }, ], }, "Type": "AWS::EC2::VPC", }, "MyVpcIGW5C4A4F63": Object { "Properties": Object { "Tags": Array [ Object { "Key": "Name", "Value": "Test/MyVpc", }, ], }, "Type": "AWS::EC2::InternetGateway", }, "MyVpcPrivateSubnet1DefaultRouteA8CDE2FA": Object { "Properties": Object { "DestinationCidrBlock": "0.0.0.0/0", "NatGatewayId": Object { "Ref": "MyVpcPublicSubnet1NATGatewayAD3400C1", }, "RouteTableId": Object { "Ref": "MyVpcPrivateSubnet1RouteTable8819E6E2", }, }, "Type": "AWS::EC2::Route", }, "MyVpcPrivateSubnet1RouteTable8819E6E2": Object { "Properties": Object { "Tags": Array [ Object { "Key": "Name", "Value": "Test/MyVpc/PrivateSubnet1", }, ], "VpcId": Object { "Ref": "MyVpcF9F0CA6F", }, }, "Type": "AWS::EC2::RouteTable", }, "MyVpcPrivateSubnet1RouteTableAssociation56D38C7E": Object { "Properties": Object { "RouteTableId": Object { "Ref": "MyVpcPrivateSubnet1RouteTable8819E6E2", }, "SubnetId": Object { "Ref": "MyVpcPrivateSubnet1Subnet5057CF7E", }, }, "Type": "AWS::EC2::SubnetRouteTableAssociation", }, "MyVpcPrivateSubnet1Subnet5057CF7E": Object { "Properties": Object { "AvailabilityZone": Object { "Fn::Select": Array [ 0, Object { "Fn::GetAZs": "", }, ], }, "CidrBlock": "10.0.128.0/18", "MapPublicIpOnLaunch": false, "Tags": Array [ Object { "Key": "aws-cdk:subnet-name", "Value": "Private", }, Object { "Key": "aws-cdk:subnet-type", "Value": "Private", }, Object { "Key": "Name", "Value": "Test/MyVpc/PrivateSubnet1", }, ], "VpcId": Object { "Ref": "MyVpcF9F0CA6F", }, }, "Type": "AWS::EC2::Subnet", }, "MyVpcPrivateSubnet2DefaultRoute9CE96294": Object { "Properties": Object { "DestinationCidrBlock": "0.0.0.0/0", "NatGatewayId": Object { "Ref": "MyVpcPublicSubnet2NATGateway91BFBEC9", }, "RouteTableId": Object { "Ref": "MyVpcPrivateSubnet2RouteTableCEDCEECE", }, }, "Type": "AWS::EC2::Route", }, "MyVpcPrivateSubnet2RouteTableAssociation86A610DA": Object { "Properties": Object { "RouteTableId": Object { "Ref": "MyVpcPrivateSubnet2RouteTableCEDCEECE", }, "SubnetId": Object { "Ref": "MyVpcPrivateSubnet2Subnet0040C983", }, }, "Type": "AWS::EC2::SubnetRouteTableAssociation", }, "MyVpcPrivateSubnet2RouteTableCEDCEECE": Object { "Properties": Object { "Tags": Array [ Object { "Key": "Name", "Value": "Test/MyVpc/PrivateSubnet2", }, ], "VpcId": Object { "Ref": "MyVpcF9F0CA6F", }, }, "Type": "AWS::EC2::RouteTable", }, "MyVpcPrivateSubnet2Subnet0040C983": Object { "Properties": Object { "AvailabilityZone": Object { "Fn::Select": Array [ 1, Object { "Fn::GetAZs": "", }, ], }, "CidrBlock": "10.0.192.0/18", "MapPublicIpOnLaunch": false, "Tags": Array [ Object { "Key": "aws-cdk:subnet-name", "Value": "Private", }, Object { "Key": "aws-cdk:subnet-type", "Value": "Private", }, Object { "Key": "Name", "Value": "Test/MyVpc/PrivateSubnet2", }, ], "VpcId": Object { "Ref": "MyVpcF9F0CA6F", }, }, "Type": "AWS::EC2::Subnet", }, "MyVpcPublicSubnet1DefaultRoute95FDF9EB": Object { "DependsOn": Array [ "MyVpcVPCGW488ACE0D", ], "Properties": Object { "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": Object { "Ref": "MyVpcIGW5C4A4F63", }, "RouteTableId": Object { "Ref": "MyVpcPublicSubnet1RouteTableC46AB2F4", }, }, "Type": "AWS::EC2::Route", }, "MyVpcPublicSubnet1EIP096967CB": Object { "Properties": Object { "Domain": "vpc", "Tags": Array [ Object { "Key": "Name", "Value": "Test/MyVpc/PublicSubnet1", }, ], }, "Type": "AWS::EC2::EIP", }, "MyVpcPublicSubnet1NATGatewayAD3400C1": Object { "DependsOn": Array [ "MyVpcPublicSubnet1DefaultRoute95FDF9EB", "MyVpcPublicSubnet1RouteTableAssociation2ECEE1CB", ], "Properties": Object { "AllocationId": Object { "Fn::GetAtt": Array [ "MyVpcPublicSubnet1EIP096967CB", "AllocationId", ], }, "SubnetId": Object { "Ref": "MyVpcPublicSubnet1SubnetF6608456", }, "Tags": Array [ Object { "Key": "Name", "Value": "Test/MyVpc/PublicSubnet1", }, ], }, "Type": "AWS::EC2::NatGateway", }, "MyVpcPublicSubnet1RouteTableAssociation2ECEE1CB": Object { "Properties": Object { "RouteTableId": Object { "Ref": "MyVpcPublicSubnet1RouteTableC46AB2F4", }, "SubnetId": Object { "Ref": "MyVpcPublicSubnet1SubnetF6608456", }, }, "Type": "AWS::EC2::SubnetRouteTableAssociation", }, "MyVpcPublicSubnet1RouteTableC46AB2F4": Object { "Properties": Object { "Tags": Array [ Object { "Key": "Name", "Value": "Test/MyVpc/PublicSubnet1", }, ], "VpcId": Object { "Ref": "MyVpcF9F0CA6F", }, }, "Type": "AWS::EC2::RouteTable", }, "MyVpcPublicSubnet1SubnetF6608456": Object { "Properties": Object { "AvailabilityZone": Object { "Fn::Select": Array [ 0, Object { "Fn::GetAZs": "", }, ], }, "CidrBlock": "10.0.0.0/18", "MapPublicIpOnLaunch": true, "Tags": Array [ Object { "Key": "aws-cdk:subnet-name", "Value": "Public", }, Object { "Key": "aws-cdk:subnet-type", "Value": "Public", }, Object { "Key": "Name", "Value": "Test/MyVpc/PublicSubnet1", }, ], "VpcId": Object { "Ref": "MyVpcF9F0CA6F", }, }, "Type": "AWS::EC2::Subnet", }, "MyVpcPublicSubnet2DefaultRoute052936F6": Object { "DependsOn": Array [ "MyVpcVPCGW488ACE0D", ], "Properties": Object { "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": Object { "Ref": "MyVpcIGW5C4A4F63", }, "RouteTableId": Object { "Ref": "MyVpcPublicSubnet2RouteTable1DF17386", }, }, "Type": "AWS::EC2::Route", }, "MyVpcPublicSubnet2EIP8CCBA239": Object { "Properties": Object { "Domain": "vpc", "Tags": Array [ Object { "Key": "Name", "Value": "Test/MyVpc/PublicSubnet2", }, ], }, "Type": "AWS::EC2::EIP", }, "MyVpcPublicSubnet2NATGateway91BFBEC9": Object { "DependsOn": Array [ "MyVpcPublicSubnet2DefaultRoute052936F6", "MyVpcPublicSubnet2RouteTableAssociation227DE78D", ], "Properties": Object { "AllocationId": Object { "Fn::GetAtt": Array [ "MyVpcPublicSubnet2EIP8CCBA239", "AllocationId", ], }, "SubnetId": Object { "Ref": "MyVpcPublicSubnet2Subnet492B6BFB", }, "Tags": Array [ Object { "Key": "Name", "Value": "Test/MyVpc/PublicSubnet2", }, ], }, "Type": "AWS::EC2::NatGateway", }, "MyVpcPublicSubnet2RouteTable1DF17386": Object { "Properties": Object { "Tags": Array [ Object { "Key": "Name", "Value": "Test/MyVpc/PublicSubnet2", }, ], "VpcId": Object { "Ref": "MyVpcF9F0CA6F", }, }, "Type": "AWS::EC2::RouteTable", }, "MyVpcPublicSubnet2RouteTableAssociation227DE78D": Object { "Properties": Object { "RouteTableId": Object { "Ref": "MyVpcPublicSubnet2RouteTable1DF17386", }, "SubnetId": Object { "Ref": "MyVpcPublicSubnet2Subnet492B6BFB", }, }, "Type": "AWS::EC2::SubnetRouteTableAssociation", }, "MyVpcPublicSubnet2Subnet492B6BFB": Object { "Properties": Object { "AvailabilityZone": Object { "Fn::Select": Array [ 1, Object { "Fn::GetAZs": "", }, ], }, "CidrBlock": "10.0.64.0/18", "MapPublicIpOnLaunch": true, "Tags": Array [ Object { "Key": "aws-cdk:subnet-name", "Value": "Public", }, Object { "Key": "aws-cdk:subnet-type", "Value": "Public", }, Object { "Key": "Name", "Value": "Test/MyVpc/PublicSubnet2", }, ], "VpcId": Object { "Ref": "MyVpcF9F0CA6F", }, }, "Type": "AWS::EC2::Subnet", }, "MyVpcVPCGW488ACE0D": Object { "Properties": Object { "InternetGatewayId": Object { "Ref": "MyVpcIGW5C4A4F63", }, "VpcId": Object { "Ref": "MyVpcF9F0CA6F", }, }, "Type": "AWS::EC2::VPCGatewayAttachment", }, }, } `; exports[`Evaluation Valid templates examples/http-proxy.yaml 1`] = ` Object { "Outputs": Object { "ProxyApiEndpoint2177970D": Object { "Value": Object { "Fn::Join": Array [ "", Array [ "https://", Object { "Ref": "ProxyApi0DF2D7AE", }, ".execute-api.", Object { "Ref": "AWS::Region", }, ".", Object { "Ref": "AWS::URLSuffix", }, "/", Object { "Ref": "ProxyApiDeploymentStageprod9EF20FCC", }, "/", ], ], }, }, }, "Parameters": Object { "ProxyUrl": Object { "AllowedPattern": ".*[^\\\\/]$", "ConstraintDescription": "MUST NOT end in a forward slash (\\"/\\")", "Default": "https://example.com", "Description": "The url to proxy", "Type": "String", }, }, "Resources": Object { "ProxyApi0DF2D7AE": Object { "Properties": Object { "EndpointConfiguration": Object { "Types": Array [ "EDGE", ], }, "Name": "WebsiteProxy", }, "Type": "AWS::ApiGateway::RestApi", }, "ProxyApiANY510A7082": Object { "Properties": Object { "AuthorizationType": "NONE", "HttpMethod": "ANY", "Integration": Object { "IntegrationHttpMethod": "GET", "Type": "HTTP_PROXY", "Uri": Object { "Ref": "ProxyUrl", }, }, "ResourceId": Object { "Fn::GetAtt": Array [ "ProxyApi0DF2D7AE", "RootResourceId", ], }, "RestApiId": Object { "Ref": "ProxyApi0DF2D7AE", }, }, "Type": "AWS::ApiGateway::Method", }, "ProxyApiAccount987F032E": Object { "DeletionPolicy": "Retain", "DependsOn": Array [ "ProxyApi0DF2D7AE", ], "Properties": Object { "CloudWatchRoleArn": Object { "Fn::GetAtt": Array [ "ProxyApiCloudWatchRole6287CBD0", "Arn", ], }, }, "Type": "AWS::ApiGateway::Account", "UpdateReplacePolicy": "Retain", }, "ProxyApiCloudWatchRole6287CBD0": Object { "DeletionPolicy": "Retain", "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "apigateway.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs", ], ], }, ], }, "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, "ProxyApiDeployment6107D4F3d730c90b47744ccbd5536158d828ed86": Object { "DependsOn": Array [ "ProxyApiANY510A7082", "ProxyResourceANYD2521206", "ProxyResourceD65343FB", ], "Properties": Object { "Description": "Automatically created by the RestApi construct", "RestApiId": Object { "Ref": "ProxyApi0DF2D7AE", }, }, "Type": "AWS::ApiGateway::Deployment", }, "ProxyApiDeploymentStageprod9EF20FCC": Object { "DependsOn": Array [ "ProxyApiAccount987F032E", ], "Properties": Object { "DeploymentId": Object { "Ref": "ProxyApiDeployment6107D4F3d730c90b47744ccbd5536158d828ed86", }, "RestApiId": Object { "Ref": "ProxyApi0DF2D7AE", }, "StageName": "prod", }, "Type": "AWS::ApiGateway::Stage", }, "ProxyResourceANYD2521206": Object { "Properties": Object { "AuthorizationType": "NONE", "HttpMethod": "ANY", "Integration": Object { "IntegrationHttpMethod": "GET", "RequestParameters": Object { "integration.request.path.proxy": "method.request.path.proxy", }, "Type": "HTTP_PROXY", "Uri": Object { "Fn::Join": Array [ "/", Array [ Object { "Ref": "ProxyUrl", }, "{proxy}", ], ], }, }, "RequestParameters": Object { "method.request.path.proxy": true, }, "ResourceId": Object { "Ref": "ProxyResourceD65343FB", }, "RestApiId": Object { "Ref": "ProxyApi0DF2D7AE", }, }, "Type": "AWS::ApiGateway::Method", }, "ProxyResourceD65343FB": Object { "Properties": Object { "ParentId": Object { "Fn::GetAtt": Array [ "ProxyApi0DF2D7AE", "RootResourceId", ], }, "PathPart": "{proxy+}", "RestApiId": Object { "Ref": "ProxyApi0DF2D7AE", }, }, "Type": "AWS::ApiGateway::Resource", }, }, } `; exports[`Evaluation Valid templates examples/integration.yaml 1`] = ` Object { "Parameters": Object { "QueueList": Object { "Default": "a,b,c,d,e,f,g", "Type": "CommaDelimitedList", }, }, "Resources": Object { "BucketDeploymentAwsCliLayerB018DCE1": Object { "Properties": Object { "Content": Object { "S3Bucket": Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", }, "Description": "/opt/awscli/aws", }, "Type": "AWS::Lambda::LayerVersion", }, "BucketDeploymentCustomResourceCB7E2133": Object { "DeletionPolicy": "Delete", "Properties": Object { "DestinationBucketName": Object { "Ref": "WebsiteBucket75C24D94", }, "Prune": true, "ServiceToken": Object { "Fn::GetAtt": Array [ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536", "Arn", ], }, "SourceBucketNames": Array [ Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, ], "SourceMarkers": Array [ Object {}, ], "SourceObjectKeys": Array [ "8aa37641f3940c794026659a75e83ccac76a603325882b9a71b39b054cab2620.zip", ], }, "Type": "Custom::CDKBucketDeployment", "UpdateReplacePolicy": "Delete", }, "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536": Object { "DependsOn": Array [ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF", "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265", ], "Properties": Object { "Code": Object { "S3Bucket": Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd.zip", }, "Environment": Object { "Variables": Object { "AWS_CA_BUNDLE": "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem", }, }, "Handler": "index.handler", "Layers": Array [ Object { "Ref": "BucketDeploymentAwsCliLayerB018DCE1", }, ], "Role": Object { "Fn::GetAtt": Array [ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265", "Arn", ], }, "Runtime": "python3.9", "Timeout": 900, }, "Type": "AWS::Lambda::Function", }, "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": Array [ "s3:GetObject*", "s3:GetBucket*", "s3:List*", ], "Effect": "Allow", "Resource": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":s3:::", Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, ], ], }, Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":s3:::", Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "/*", ], ], }, ], }, Object { "Action": Array [ "s3:GetObject*", "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", "s3:PutObject", "s3:PutObjectLegalHold", "s3:PutObjectRetention", "s3:PutObjectTagging", "s3:PutObjectVersionTagging", "s3:Abort*", ], "Effect": "Allow", "Resource": Array [ Object { "Fn::GetAtt": Array [ "WebsiteBucket75C24D94", "Arn", ], }, Object { "Fn::Join": Array [ "", Array [ Object { "Fn::GetAtt": Array [ "WebsiteBucket75C24D94", "Arn", ], }, "/*", ], ], }, ], }, ], "Version": "2012-10-17", }, "PolicyName": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF", "Roles": Array [ Object { "Ref": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265", }, ], }, "Type": "AWS::IAM::Policy", }, "Function76856677": Object { "DependsOn": Array [ "FunctionServiceRoleDefaultPolicy2F49994A", "FunctionServiceRole675BB04A", ], "Properties": Object { "Code": Object { "ZipFile": "exports.handler = async () => { console.log('hello world'); };", }, "Handler": "index.handler", "Role": Object { "Fn::GetAtt": Array [ "FunctionServiceRole675BB04A", "Arn", ], }, "Runtime": "nodejs14.x", "Timeout": Object { "Fn::Length": Object { "Ref": "QueueList", }, }, }, "Type": "AWS::Lambda::Function", }, "FunctionServiceRole675BB04A": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "FunctionServiceRoleDefaultPolicy2F49994A": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": Array [ "s3:GetObject*", "s3:GetBucket*", "s3:List*", ], "Effect": "Allow", "Resource": Array [ Object { "Fn::GetAtt": Array [ "WebsiteBucket75C24D94", "Arn", ], }, Object { "Fn::Join": Array [ "", Array [ Object { "Fn::GetAtt": Array [ "WebsiteBucket75C24D94", "Arn", ], }, "/*", ], ], }, ], }, ], "Version": "2012-10-17", }, "PolicyName": "FunctionServiceRoleDefaultPolicy2F49994A", "Roles": Array [ Object { "Ref": "FunctionServiceRole675BB04A", }, ], }, "Type": "AWS::IAM::Policy", }, "Queue": Object { "DeletionPolicy": "Delete", "Properties": Object { "DelaySeconds": Object { "Fn::Length": Object { "Ref": "QueueList", }, }, }, "Type": "AWS::SQS::Queue", "UpdateReplacePolicy": "Delete", }, "RotationSchedule2A725270": Object { "Properties": Object { "HostedRotationLambda": Object { "ExcludeCharacters": " %+~\`#$&*()|[]{}:;<>?!'/@\\"\\\\", "RotationType": "MySQLSingleUser", }, "RotationRules": Object { "AutomaticallyAfterDays": 30, }, "SecretId": Object { "Ref": "SecretA720EF05", }, }, "Type": "AWS::SecretsManager::RotationSchedule", }, "SecretA720EF05": Object { "DeletionPolicy": "Delete", "Properties": Object { "GenerateSecretString": Object {}, }, "Type": "AWS::SecretsManager::Secret", "UpdateReplacePolicy": "Delete", }, "SecretPolicy06C9821C": Object { "Properties": Object { "ResourcePolicy": Object { "Statement": Array [ Object { "Action": "secretsmanager:DeleteSecret", "Effect": "Deny", "Principal": Object { "AWS": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::", Object { "Ref": "AWS::AccountId", }, ":root", ], ], }, }, "Resource": "*", }, ], "Version": "2012-10-17", }, "SecretId": Object { "Ref": "SecretA720EF05", }, }, "Type": "AWS::SecretsManager::ResourcePolicy", }, "WebsiteBucket75C24D94": Object { "DeletionPolicy": "Retain", "Properties": Object { "Tags": Array [ Object { "Key": "aws-cdk:cr-owned:e227f112", "Value": "true", }, ], }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Retain", }, }, "Transform": Array [ "AWS::LanguageExtensions", "AWS::SecretsManager-2020-07-23", ], } `; exports[`Evaluation Valid templates examples/lambda-dashboard.yaml 1`] = ` Object { "Mappings": Object { "DefaultCrNodeVersionMap": Object { "af-south-1": Object { "value": "nodejs16.x", }, "ap-east-1": Object { "value": "nodejs16.x", }, "ap-northeast-1": Object { "value": "nodejs16.x", }, "ap-northeast-2": Object { "value": "nodejs16.x", }, "ap-northeast-3": Object { "value": "nodejs16.x", }, "ap-south-1": Object { "value": "nodejs16.x", }, "ap-south-2": Object { "value": "nodejs16.x", }, "ap-southeast-1": Object { "value": "nodejs16.x", }, "ap-southeast-2": Object { "value": "nodejs16.x", }, "ap-southeast-3": Object { "value": "nodejs16.x", }, "ca-central-1": Object { "value": "nodejs16.x", }, "cn-north-1": Object { "value": "nodejs16.x", }, "cn-northwest-1": Object { "value": "nodejs16.x", }, "eu-central-1": Object { "value": "nodejs16.x", }, "eu-central-2": Object { "value": "nodejs16.x", }, "eu-north-1": Object { "value": "nodejs16.x", }, "eu-south-1": Object { "value": "nodejs16.x", }, "eu-south-2": Object { "value": "nodejs16.x", }, "eu-west-1": Object { "value": "nodejs16.x", }, "eu-west-2": Object { "value": "nodejs16.x", }, "eu-west-3": Object { "value": "nodejs16.x", }, "me-central-1": Object { "value": "nodejs16.x", }, "me-south-1": Object { "value": "nodejs16.x", }, "sa-east-1": Object { "value": "nodejs16.x", }, "us-east-1": Object { "value": "nodejs16.x", }, "us-east-2": Object { "value": "nodejs16.x", }, "us-gov-east-1": Object { "value": "nodejs16.x", }, "us-gov-west-1": Object { "value": "nodejs16.x", }, "us-iso-east-1": Object { "value": "nodejs14.x", }, "us-iso-west-1": Object { "value": "nodejs14.x", }, "us-isob-east-1": Object { "value": "nodejs14.x", }, "us-west-1": Object { "value": "nodejs16.x", }, "us-west-2": Object { "value": "nodejs16.x", }, }, }, "Parameters": Object { "DashboardName": Object { "AllowedPattern": "^[a-zA-Z0-9-_]*$", "Default": "SampleDashboard", "Type": "String", }, }, "Resources": Object { "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A": Object { "DependsOn": Array [ "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB", ], "Properties": Object { "Code": Object { "S3Bucket": Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "5fa1330271b8967d9254ba2d4a07144f8acefe8b77e6d6bba38261373a50d5f8.zip", }, "Handler": "index.handler", "Role": Object { "Fn::GetAtt": Array [ "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB", "Arn", ], }, "Runtime": Object { "Fn::FindInMap": Array [ "DefaultCrNodeVersionMap", Object { "Ref": "AWS::Region", }, "value", ], }, }, "Type": "AWS::Lambda::Function", }, "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": Array [ "logs:PutRetentionPolicy", "logs:DeleteRetentionPolicy", ], "Effect": "Allow", "Resource": "*", }, ], "Version": "2012-10-17", }, "PolicyName": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", "Roles": Array [ Object { "Ref": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB", }, ], }, "Type": "AWS::IAM::Policy", }, "SampleLambdaB2FF4FA1": Object { "DependsOn": Array [ "SampleLambdaServiceRoleB1A8618F", ], "Properties": Object { "Code": Object { "S3Bucket": Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "41b1de375e679030ee7361874b689e99ab0657e9d274a8e6193d1513940a0c2f.zip", }, "Handler": "index.handler", "MemorySize": 512, "Role": Object { "Fn::GetAtt": Array [ "SampleLambdaServiceRoleB1A8618F", "Arn", ], }, "Runtime": "nodejs16.x", "Timeout": 10, }, "Type": "AWS::Lambda::Function", }, "SampleLambdaLogRetentionE3451573": Object { "Properties": Object { "LogGroupName": Object { "Fn::Join": Array [ "", Array [ "/aws/lambda/", Object { "Ref": "SampleLambdaB2FF4FA1", }, ], ], }, "ServiceToken": Object { "Fn::GetAtt": Array [ "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", "Arn", ], }, }, "Type": "Custom::LogRetention", }, "SampleLambdaServiceRoleB1A8618F": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "ServiceDashboard3C555A71": Object { "Properties": Object { "DashboardBody": Object { "Fn::Join": Array [ "", Array [ "{\\"widgets\\":[{\\"type\\":\\"text\\",\\"width\\":6,\\"height\\":2,\\"x\\":0,\\"y\\":0,\\"properties\\":{\\"markdown\\":\\"# Operational Metrics: ", Object { "Ref": "SampleLambdaB2FF4FA1", }, "\\"}},{\\"type\\":\\"metric\\",\\"width\\":6,\\"height\\":6,\\"x\\":6,\\"y\\":0,\\"properties\\":{\\"view\\":\\"timeSeries\\",\\"title\\":\\"Invocations\\",\\"region\\":\\"", Object { "Ref": "AWS::Region", }, "\\",\\"metrics\\":[[\\"AWS/Lambda\\",\\"Invocations\\",\\"FunctionName\\",\\"", Object { "Ref": "SampleLambdaB2FF4FA1", }, "\\",{\\"stat\\":\\"Sum\\"}]],\\"yAxis\\":{}}},{\\"type\\":\\"metric\\",\\"width\\":6,\\"height\\":6,\\"x\\":12,\\"y\\":0,\\"properties\\":{\\"view\\":\\"timeSeries\\",\\"title\\":\\"Errors\\",\\"region\\":\\"", Object { "Ref": "AWS::Region", }, "\\",\\"metrics\\":[[\\"AWS/Lambda\\",\\"Errors\\",\\"FunctionName\\",\\"", Object { "Ref": "SampleLambdaB2FF4FA1", }, "\\",{\\"stat\\":\\"Sum\\"}]],\\"yAxis\\":{}}},{\\"type\\":\\"metric\\",\\"width\\":6,\\"height\\":6,\\"x\\":18,\\"y\\":0,\\"properties\\":{\\"view\\":\\"timeSeries\\",\\"title\\":\\"Duration\\",\\"region\\":\\"", Object { "Ref": "AWS::Region", }, "\\",\\"metrics\\":[[\\"AWS/Lambda\\",\\"Duration\\",\\"FunctionName\\",\\"", Object { "Ref": "SampleLambdaB2FF4FA1", }, "\\"]],\\"yAxis\\":{}}},{\\"type\\":\\"metric\\",\\"width\\":6,\\"height\\":6,\\"x\\":0,\\"y\\":6,\\"properties\\":{\\"view\\":\\"timeSeries\\",\\"title\\":\\"Throttles\\",\\"region\\":\\"", Object { "Ref": "AWS::Region", }, "\\",\\"metrics\\":[[\\"AWS/Lambda\\",\\"Throttles\\",\\"FunctionName\\",\\"", Object { "Ref": "SampleLambdaB2FF4FA1", }, "\\",{\\"stat\\":\\"Sum\\"}]],\\"yAxis\\":{}}},{\\"type\\":\\"log\\",\\"width\\":24,\\"height\\":6,\\"x\\":0,\\"y\\":12,\\"properties\\":{\\"view\\":\\"table\\",\\"region\\":\\"", Object { "Ref": "AWS::Region", }, "\\",\\"query\\":\\"SOURCE '", Object { "Fn::GetAtt": Array [ "SampleLambdaLogRetentionE3451573", "LogGroupName", ], }, "' | fields @timestamp, @message\\\\n| sort @timestamp desc\\\\n| limit 20\\"}}]}", ], ], }, "DashboardName": Object { "Ref": "DashboardName", }, }, "Type": "AWS::CloudWatch::Dashboard", }, }, } `; exports[`Evaluation Valid templates examples/lambda-events.json 1`] = ` Object { "Description": "A template creates a lambda function which can be invoked by an sns topic", "Outputs": Object { "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FEndpointA8F0470B": Object { "Value": Object { "Fn::Join": Array [ "", Array [ "https://", Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", }, ".execute-api.", Object { "Ref": "AWS::Region", }, ".", Object { "Ref": "AWS::URLSuffix", }, "/", Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FDeploymentStageprodA76DE31E", }, "/", ], ], }, }, }, "Resources": Object { "HelloWorldFunctionAllowInvokeTestMyTopic06942AEA43E66FD3": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloWorldFunctionB2AB6E79", "Arn", ], }, "Principal": "sns.amazonaws.com", "SourceArn": Object { "Ref": "MyTopic86869434", }, }, "Type": "AWS::Lambda::Permission", }, "HelloWorldFunctionB2AB6E79": Object { "DependsOn": Array [ "HelloWorldFunctionServiceRoleDefaultPolicy6CCD7798", "HelloWorldFunctionServiceRole8E0BD458", ], "Properties": Object { "Code": Object { "S3Bucket": Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "41b1de375e679030ee7361874b689e99ab0657e9d274a8e6193d1513940a0c2f.zip", }, "Environment": Object { "Variables": Object { "Param": "f", }, }, "Handler": "app.hello_handler", "Role": Object { "Fn::GetAtt": Array [ "HelloWorldFunctionServiceRole8E0BD458", "Arn", ], }, "Runtime": "python3.6", }, "Type": "AWS::Lambda::Function", }, "HelloWorldFunctionDynamoDBEventSourceTestTable7FB9A4AF14EA3849": Object { "Properties": Object { "BatchSize": 100, "EventSourceArn": Object { "Fn::GetAtt": Array [ "TableCD117FA1", "StreamArn", ], }, "FunctionName": Object { "Ref": "HelloWorldFunctionB2AB6E79", }, "StartingPosition": "TRIM_HORIZON", }, "Type": "AWS::Lambda::EventSourceMapping", }, "HelloWorldFunctionMyTopic90F6E0EF": Object { "Properties": Object { "Endpoint": Object { "Fn::GetAtt": Array [ "HelloWorldFunctionB2AB6E79", "Arn", ], }, "Protocol": "lambda", "TopicArn": Object { "Ref": "MyTopic86869434", }, }, "Type": "AWS::SNS::Subscription", }, "HelloWorldFunctionServiceRole8E0BD458": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "HelloWorldFunctionServiceRoleDefaultPolicy6CCD7798": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": "dynamodb:ListStreams", "Effect": "Allow", "Resource": "*", }, Object { "Action": Array [ "dynamodb:DescribeStream", "dynamodb:GetRecords", "dynamodb:GetShardIterator", ], "Effect": "Allow", "Resource": Object { "Fn::GetAtt": Array [ "TableCD117FA1", "StreamArn", ], }, }, ], "Version": "2012-10-17", }, "PolicyName": "HelloWorldFunctionServiceRoleDefaultPolicy6CCD7798", "Roles": Array [ Object { "Ref": "HelloWorldFunctionServiceRole8E0BD458", }, ], }, "Type": "AWS::IAM::Policy", }, "MyTopic86869434": Object { "Type": "AWS::SNS::Topic", }, "TableCD117FA1": Object { "DeletionPolicy": "Retain", "Properties": Object { "AttributeDefinitions": Array [ Object { "AttributeName": "ID", "AttributeType": "S", }, ], "KeySchema": Array [ Object { "AttributeName": "ID", "KeyType": "HASH", }, ], "ProvisionedThroughput": Object { "ReadCapacityUnits": 5, "WriteCapacityUnits": 5, }, "StreamSpecification": Object { "StreamViewType": "NEW_AND_OLD_IMAGES", }, }, "Type": "AWS::DynamoDB::Table", "UpdateReplacePolicy": "Retain", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA": Object { "Properties": Object { "Name": "TestHelloWorldFunctionE7E220B2:ApiEventSourceA7A86A4F", }, "Type": "AWS::ApiGateway::RestApi", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FAccount3FF2838C": Object { "DeletionPolicy": "Retain", "DependsOn": Array [ "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", ], "Properties": Object { "CloudWatchRoleArn": Object { "Fn::GetAtt": Array [ "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FCloudWatchRole6F1F54C4", "Arn", ], }, }, "Type": "AWS::ApiGateway::Account", "UpdateReplacePolicy": "Retain", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FCloudWatchRole6F1F54C4": Object { "DeletionPolicy": "Retain", "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "apigateway.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs", ], ], }, ], }, "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FDeployment1521BDCD1184383c2312dd2bd094c1c0b9e7069a": Object { "DependsOn": Array [ "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FhelloGETDEC3A558", "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FhelloPOST26F53363", "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4Fhello434790F5", ], "Properties": Object { "Description": "Automatically created by the RestApi construct", "RestApiId": Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", }, }, "Type": "AWS::ApiGateway::Deployment", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FDeploymentStageprodA76DE31E": Object { "DependsOn": Array [ "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FAccount3FF2838C", ], "Properties": Object { "DeploymentId": Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FDeployment1521BDCD1184383c2312dd2bd094c1c0b9e7069a", }, "RestApiId": Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", }, "StageName": "prod", }, "Type": "AWS::ApiGateway::Stage", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4Fhello434790F5": Object { "Properties": Object { "ParentId": Object { "Fn::GetAtt": Array [ "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", "RootResourceId", ], }, "PathPart": "hello", "RestApiId": Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", }, }, "Type": "AWS::ApiGateway::Resource", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FhelloGETApiPermissionTestTestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F2B53EF41GEThello55F7F880": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloWorldFunctionB2AB6E79", "Arn", ], }, "Principal": "apigateway.amazonaws.com", "SourceArn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":execute-api:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", }, "/", Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FDeploymentStageprodA76DE31E", }, "/GET/hello", ], ], }, }, "Type": "AWS::Lambda::Permission", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FhelloGETApiPermissionTestTestTestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F2B53EF41GEThelloDA94F7CA": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloWorldFunctionB2AB6E79", "Arn", ], }, "Principal": "apigateway.amazonaws.com", "SourceArn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":execute-api:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", }, "/test-invoke-stage/GET/hello", ], ], }, }, "Type": "AWS::Lambda::Permission", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FhelloGETDEC3A558": Object { "Properties": Object { "AuthorizationType": "NONE", "HttpMethod": "GET", "Integration": Object { "IntegrationHttpMethod": "POST", "Type": "AWS_PROXY", "Uri": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":apigateway:", Object { "Ref": "AWS::Region", }, ":lambda:path/2015-03-31/functions/", Object { "Fn::GetAtt": Array [ "HelloWorldFunctionB2AB6E79", "Arn", ], }, "/invocations", ], ], }, }, "ResourceId": Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4Fhello434790F5", }, "RestApiId": Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", }, }, "Type": "AWS::ApiGateway::Method", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FhelloPOST26F53363": Object { "Properties": Object { "AuthorizationType": "NONE", "HttpMethod": "POST", "Integration": Object { "IntegrationHttpMethod": "POST", "Type": "AWS_PROXY", "Uri": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":apigateway:", Object { "Ref": "AWS::Region", }, ":lambda:path/2015-03-31/functions/", Object { "Fn::GetAtt": Array [ "HelloWorldFunctionB2AB6E79", "Arn", ], }, "/invocations", ], ], }, }, "ResourceId": Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4Fhello434790F5", }, "RestApiId": Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", }, }, "Type": "AWS::ApiGateway::Method", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FhelloPOSTApiPermissionTestTestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F2B53EF41POSThelloAFA34AF4": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloWorldFunctionB2AB6E79", "Arn", ], }, "Principal": "apigateway.amazonaws.com", "SourceArn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":execute-api:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", }, "/", Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FDeploymentStageprodA76DE31E", }, "/POST/hello", ], ], }, }, "Type": "AWS::Lambda::Permission", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FhelloPOSTApiPermissionTestTestTestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F2B53EF41POSThello70EA31F2": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloWorldFunctionB2AB6E79", "Arn", ], }, "Principal": "apigateway.amazonaws.com", "SourceArn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":execute-api:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", }, "/test-invoke-stage/POST/hello", ], ], }, }, "Type": "AWS::Lambda::Permission", }, }, } `; exports[`Evaluation Valid templates examples/lambda-layer.json 1`] = ` Object { "AWSTemplateFormatVersion": "2010-09-09", "Description": "A template creates a aws cli lambda layer", "Resources": Object { "AwsCliLayerF44AAF94": Object { "Properties": Object { "Content": Object { "S3Bucket": Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", }, "Description": "/opt/awscli/aws", }, "Type": "AWS::Lambda::LayerVersion", }, "LambdaD247545B": Object { "DependsOn": Array [ "LambdaServiceRoleA8ED4D3B", ], "Properties": Object { "Code": Object { "ZipFile": "exports.handler = async function() { return 'SUCCESS'; }", }, "Handler": "index.handler", "Layers": Array [ Object { "Ref": "AwsCliLayerF44AAF94", }, ], "Role": Object { "Fn::GetAtt": Array [ "LambdaServiceRoleA8ED4D3B", "Arn", ], }, "Runtime": "nodejs16.x", }, "Type": "AWS::Lambda::Function", }, "LambdaServiceRoleA8ED4D3B": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], }, "Type": "AWS::IAM::Role", }, }, } `; exports[`Evaluation Valid templates examples/lambda-policy.yaml 1`] = ` Object { "Parameters": Object { "BucketName": Object { "Type": "String", }, "Stage": Object { "Default": "Gamma", "Type": "String", }, }, "Resources": Object { "MyBucketF68F3FF0": Object { "DeletionPolicy": "Retain", "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Retain", }, "MyLambdaCCE802FB": Object { "DependsOn": Array [ "MyLambdaServiceRoleDefaultPolicy5BBC6F68", "MyLambdaServiceRole4539ECB6", ], "Properties": Object { "Code": Object { "S3Bucket": Object { "Ref": "MyBucketF68F3FF0", }, "S3Key": "handler.zip", }, "Handler": "index.handler", "MemorySize": 10240, "Role": Object { "Fn::GetAtt": Array [ "MyLambdaServiceRole4539ECB6", "Arn", ], }, "Runtime": "nodejs16.x", }, "Type": "AWS::Lambda::Function", }, "MyLambdaServiceRole4539ECB6": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "MyLambdaServiceRoleDefaultPolicy5BBC6F68": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": Array [ "s3:GetObject*", "s3:PutObject*", ], "Effect": "Allow", "Resource": Array [ Object { "Ref": "MyBucketF68F3FF0", }, Object { "Fn::Join": Array [ "", Array [ Object { "Fn::GetAtt": Array [ "MyBucketF68F3FF0", "Arn", ], }, "/*", ], ], }, ], }, ], "Version": "2012-10-17", }, "PolicyName": "MyLambdaServiceRoleDefaultPolicy5BBC6F68", "Roles": Array [ Object { "Ref": "MyLambdaServiceRole4539ECB6", }, ], }, "Type": "AWS::IAM::Policy", }, }, } `; exports[`Evaluation Valid templates examples/lambda-topic.json 1`] = ` Object { "Resources": Object { "LambdaAllowInvokeTestTopic346FF53781B07C89": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "LambdaD247545B", "Arn", ], }, "Principal": "sns.amazonaws.com", "SourceArn": Object { "Ref": "TopicBFC7AF6E", }, }, "Type": "AWS::Lambda::Permission", }, "LambdaD247545B": Object { "DependsOn": Array [ "LambdaServiceRoleA8ED4D3B", ], "Properties": Object { "Code": Object { "S3Bucket": Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "41b1de375e679030ee7361874b689e99ab0657e9d274a8e6193d1513940a0c2f.zip", }, "Handler": "index.handler", "Role": Object { "Fn::GetAtt": Array [ "LambdaServiceRoleA8ED4D3B", "Arn", ], }, "Runtime": "nodejs", }, "Type": "AWS::Lambda::Function", }, "LambdaServiceRoleA8ED4D3B": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "LambdaTopicCCB0C2A3": Object { "Properties": Object { "Endpoint": Object { "Fn::GetAtt": Array [ "LambdaD247545B", "Arn", ], }, "Protocol": "lambda", "TopicArn": Object { "Ref": "TopicBFC7AF6E", }, }, "Type": "AWS::SNS::Subscription", }, "TopicBFC7AF6E": Object { "Type": "AWS::SNS::Topic", }, }, } `; exports[`Evaluation Valid templates examples/pipeline.json 1`] = ` Object { "AWSTemplateFormatVersion": "2010-09-09", "Description": "A template creates a CodePipeline along with its CodeCommit repository source", "Resources": Object { "BuildProject097C5DB7": Object { "Properties": Object { "Artifacts": Object { "Type": "CODEPIPELINE", }, "Cache": Object { "Type": "NO_CACHE", }, "EncryptionKey": Object { "Fn::GetAtt": Array [ "Key961B73FD", "Arn", ], }, "Environment": Object { "ComputeType": "BUILD_GENERAL1_SMALL", "Image": "aws/codebuild/standard:1.0", "ImagePullCredentialsType": "CODEBUILD", "PrivilegedMode": false, "Type": "LINUX_CONTAINER", }, "ServiceRole": Object { "Fn::GetAtt": Array [ "BuildProjectRoleAA92C755", "Arn", ], }, "Source": Object { "Type": "CODEPIPELINE", }, }, "Type": "AWS::CodeBuild::Project", }, "BuildProjectRoleAA92C755": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "codebuild.amazonaws.com", }, }, ], "Version": "2012-10-17", }, }, "Type": "AWS::IAM::Role", }, "BuildProjectRoleDefaultPolicy3E9F248C": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": Array [ "logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents", ], "Effect": "Allow", "Resource": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":logs:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":log-group:/aws/codebuild/", Object { "Ref": "BuildProject097C5DB7", }, ], ], }, Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":logs:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":log-group:/aws/codebuild/", Object { "Ref": "BuildProject097C5DB7", }, ":*", ], ], }, ], }, Object { "Action": Array [ "codebuild:CreateReportGroup", "codebuild:CreateReport", "codebuild:UpdateReport", "codebuild:BatchPutTestCases", "codebuild:BatchPutCodeCoverages", ], "Effect": "Allow", "Resource": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":codebuild:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":report-group/", Object { "Ref": "BuildProject097C5DB7", }, "-*", ], ], }, }, Object { "Action": Array [ "kms:Decrypt", "kms:Encrypt", "kms:ReEncrypt*", "kms:GenerateDataKey*", ], "Effect": "Allow", "Resource": Object { "Fn::GetAtt": Array [ "Key961B73FD", "Arn", ], }, }, Object { "Action": Array [ "s3:GetObject*", "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", "s3:PutObject", "s3:PutObjectLegalHold", "s3:PutObjectRetention", "s3:PutObjectTagging", "s3:PutObjectVersionTagging", "s3:Abort*", ], "Effect": "Allow", "Resource": Array [ Object { "Fn::GetAtt": Array [ "PipelineArtifactsBucket22248F97", "Arn", ], }, Object { "Fn::Join": Array [ "", Array [ Object { "Fn::GetAtt": Array [ "PipelineArtifactsBucket22248F97", "Arn", ], }, "/*", ], ], }, ], }, Object { "Action": Array [ "kms:Decrypt", "kms:DescribeKey", "kms:Encrypt", "kms:ReEncrypt*", "kms:GenerateDataKey*", ], "Effect": "Allow", "Resource": Object { "Fn::GetAtt": Array [ "PipelineArtifactsBucketEncryptionKey01D58D69", "Arn", ], }, }, ], "Version": "2012-10-17", }, "PolicyName": "BuildProjectRoleDefaultPolicy3E9F248C", "Roles": Array [ Object { "Ref": "BuildProjectRoleAA92C755", }, ], }, "Type": "AWS::IAM::Policy", }, "Key961B73FD": Object { "DeletionPolicy": "Retain", "Properties": Object { "KeyPolicy": Object { "Statement": Array [ Object { "Action": "kms:*", "Effect": "Allow", "Principal": Object { "AWS": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::", Object { "Ref": "AWS::AccountId", }, ":root", ], ], }, }, "Resource": "*", }, ], "Version": "2012-10-17", }, }, "Type": "AWS::KMS::Key", "UpdateReplacePolicy": "Retain", }, "PipelineArtifactsBucket22248F97": Object { "DeletionPolicy": "Retain", "Properties": Object { "BucketEncryption": Object { "ServerSideEncryptionConfiguration": Array [ Object { "ServerSideEncryptionByDefault": Object { "KMSMasterKeyID": Object { "Fn::GetAtt": Array [ "PipelineArtifactsBucketEncryptionKey01D58D69", "Arn", ], }, "SSEAlgorithm": "aws:kms", }, }, ], }, "PublicAccessBlockConfiguration": Object { "BlockPublicAcls": true, "BlockPublicPolicy": true, "IgnorePublicAcls": true, "RestrictPublicBuckets": true, }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Retain", }, "PipelineArtifactsBucketEncryptionKey01D58D69": Object { "DeletionPolicy": "Delete", "Properties": Object { "KeyPolicy": Object { "Statement": Array [ Object { "Action": "kms:*", "Effect": "Allow", "Principal": Object { "AWS": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::", Object { "Ref": "AWS::AccountId", }, ":root", ], ], }, }, "Resource": "*", }, ], "Version": "2012-10-17", }, }, "Type": "AWS::KMS::Key", "UpdateReplacePolicy": "Delete", }, "PipelineArtifactsBucketEncryptionKeyAlias5C510EEE": Object { "DeletionPolicy": "Delete", "Properties": Object { "AliasName": "alias/codepipeline-testpipeline9942903c", "TargetKeyId": Object { "Fn::GetAtt": Array [ "PipelineArtifactsBucketEncryptionKey01D58D69", "Arn", ], }, }, "Type": "AWS::KMS::Alias", "UpdateReplacePolicy": "Delete", }, "PipelineArtifactsBucketPolicyD4F9712A": Object { "Properties": Object { "Bucket": Object { "Ref": "PipelineArtifactsBucket22248F97", }, "PolicyDocument": Object { "Statement": Array [ Object { "Action": "s3:*", "Condition": Object { "Bool": Object { "aws:SecureTransport": "false", }, }, "Effect": "Deny", "Principal": Object { "AWS": "*", }, "Resource": Array [ Object { "Fn::GetAtt": Array [ "PipelineArtifactsBucket22248F97", "Arn", ], }, Object { "Fn::Join": Array [ "", Array [ Object { "Fn::GetAtt": Array [ "PipelineArtifactsBucket22248F97", "Arn", ], }, "/*", ], ], }, ], }, ], "Version": "2012-10-17", }, }, "Type": "AWS::S3::BucketPolicy", }, "PipelineBuildCodePipelineActionRoleD77A08E6": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "AWS": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::", Object { "Ref": "AWS::AccountId", }, ":root", ], ], }, }, }, ], "Version": "2012-10-17", }, }, "Type": "AWS::IAM::Role", }, "PipelineBuildCodePipelineActionRoleDefaultPolicyC9CB73F8": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": Array [ "codebuild:BatchGetBuilds", "codebuild:StartBuild", "codebuild:StopBuild", ], "Effect": "Allow", "Resource": Object { "Fn::GetAtt": Array [ "BuildProject097C5DB7", "Arn", ], }, }, ], "Version": "2012-10-17", }, "PolicyName": "PipelineBuildCodePipelineActionRoleDefaultPolicyC9CB73F8", "Roles": Array [ Object { "Ref": "PipelineBuildCodePipelineActionRoleD77A08E6", }, ], }, "Type": "AWS::IAM::Policy", }, "PipelineC660917D": Object { "DependsOn": Array [ "PipelineRoleDefaultPolicyC7A05455", "PipelineRoleD68726F7", ], "Properties": Object { "ArtifactStore": Object { "EncryptionKey": Object { "Id": Object { "Fn::GetAtt": Array [ "PipelineArtifactsBucketEncryptionKey01D58D69", "Arn", ], }, "Type": "KMS", }, "Location": Object { "Ref": "PipelineArtifactsBucket22248F97", }, "Type": "S3", }, "RoleArn": Object { "Fn::GetAtt": Array [ "PipelineRoleD68726F7", "Arn", ], }, "Stages": Array [ Object { "Actions": Array [ Object { "ActionTypeId": Object { "Category": "Source", "Owner": "AWS", "Provider": "CodeCommit", "Version": "1", }, "Configuration": Object { "BranchName": "master", "PollForSourceChanges": false, "RepositoryName": Object { "Fn::GetAtt": Array [ "Repo02AC86CF", "Name", ], }, }, "Name": "Source", "OutputArtifacts": Array [ Object { "Name": "Source", }, ], "RoleArn": Object { "Fn::GetAtt": Array [ "PipelineSourceCodePipelineActionRoleC6F9E7F5", "Arn", ], }, "RunOrder": 1, }, ], "Name": "Source", }, Object { "Actions": Array [ Object { "ActionTypeId": Object { "Category": "Build", "Owner": "AWS", "Provider": "CodeBuild", "Version": "1", }, "Configuration": Object { "ProjectName": Object { "Ref": "BuildProject097C5DB7", }, }, "InputArtifacts": Array [ Object { "Name": "Source", }, ], "Name": "Build", "OutputArtifacts": Array [ Object { "Name": "Build", }, ], "RoleArn": Object { "Fn::GetAtt": Array [ "PipelineBuildCodePipelineActionRoleD77A08E6", "Arn", ], }, "RunOrder": 1, }, ], "Name": "Build", }, Object { "Actions": Array [ Object { "ActionTypeId": Object { "Category": "Deploy", "Owner": "AWS", "Provider": "CloudFormation", "Version": "1", }, "Configuration": Object { "ActionMode": "CREATE_UPDATE", "Capabilities": "CAPABILITY_NAMED_IAM", "RoleArn": Object { "Fn::GetAtt": Array [ "PipelineDeployRole97597E3E", "Arn", ], }, "StackName": "MyStack", "TemplatePath": "Build::template.yaml", }, "InputArtifacts": Array [ Object { "Name": "Build", }, ], "Name": "Deploy", "RoleArn": Object { "Fn::GetAtt": Array [ "PipelineDeployCodePipelineActionRole8B83082E", "Arn", ], }, "RunOrder": 1, }, ], "Name": "Deploy", }, ], }, "Type": "AWS::CodePipeline::Pipeline", }, "PipelineDeployCodePipelineActionRole8B83082E": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "AWS": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::", Object { "Ref": "AWS::AccountId", }, ":root", ], ], }, }, }, ], "Version": "2012-10-17", }, }, "Type": "AWS::IAM::Role", }, "PipelineDeployCodePipelineActionRoleDefaultPolicyEE6D615B": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": "iam:PassRole", "Effect": "Allow", "Resource": Object { "Fn::GetAtt": Array [ "PipelineDeployRole97597E3E", "Arn", ], }, }, Object { "Action": Array [ "s3:GetObject*", "s3:GetBucket*", "s3:List*", ], "Effect": "Allow", "Resource": Array [ Object { "Fn::GetAtt": Array [ "PipelineArtifactsBucket22248F97", "Arn", ], }, Object { "Fn::Join": Array [ "", Array [ Object { "Fn::GetAtt": Array [ "PipelineArtifactsBucket22248F97", "Arn", ], }, "/*", ], ], }, ], }, Object { "Action": Array [ "kms:Decrypt", "kms:DescribeKey", ], "Effect": "Allow", "Resource": Object { "Fn::GetAtt": Array [ "PipelineArtifactsBucketEncryptionKey01D58D69", "Arn", ], }, }, Object { "Action": Array [ "cloudformation:CreateStack", "cloudformation:DescribeStack*", "cloudformation:GetStackPolicy", "cloudformation:GetTemplate*", "cloudformation:SetStackPolicy", "cloudformation:UpdateStack", "cloudformation:ValidateTemplate", ], "Effect": "Allow", "Resource": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":cloudformation:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":stack/MyStack/*", ], ], }, }, ], "Version": "2012-10-17", }, "PolicyName": "PipelineDeployCodePipelineActionRoleDefaultPolicyEE6D615B", "Roles": Array [ Object { "Ref": "PipelineDeployCodePipelineActionRole8B83082E", }, ], }, "Type": "AWS::IAM::Policy", }, "PipelineDeployRole97597E3E": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "cloudformation.amazonaws.com", }, }, ], "Version": "2012-10-17", }, }, "Type": "AWS::IAM::Role", }, "PipelineDeployRoleDefaultPolicy90429F22": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": Array [ "s3:GetObject*", "s3:GetBucket*", "s3:List*", ], "Effect": "Allow", "Resource": Array [ Object { "Fn::GetAtt": Array [ "PipelineArtifactsBucket22248F97", "Arn", ], }, Object { "Fn::Join": Array [ "", Array [ Object { "Fn::GetAtt": Array [ "PipelineArtifactsBucket22248F97", "Arn", ], }, "/*", ], ], }, ], }, Object { "Action": Array [ "kms:Decrypt", "kms:DescribeKey", ], "Effect": "Allow", "Resource": Object { "Fn::GetAtt": Array [ "PipelineArtifactsBucketEncryptionKey01D58D69", "Arn", ], }, }, Object { "Action": "*", "Effect": "Allow", "Resource": "*", }, ], "Version": "2012-10-17", }, "PolicyName": "PipelineDeployRoleDefaultPolicy90429F22", "Roles": Array [ Object { "Ref": "PipelineDeployRole97597E3E", }, ], }, "Type": "AWS::IAM::Policy", }, "PipelineEventsRole46BEEA7C": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "events.amazonaws.com", }, }, ], "Version": "2012-10-17", }, }, "Type": "AWS::IAM::Role", }, "PipelineEventsRoleDefaultPolicyFF4FCCE0": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": "codepipeline:StartPipelineExecution", "Effect": "Allow", "Resource": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":codepipeline:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "PipelineC660917D", }, ], ], }, }, ], "Version": "2012-10-17", }, "PolicyName": "PipelineEventsRoleDefaultPolicyFF4FCCE0", "Roles": Array [ Object { "Ref": "PipelineEventsRole46BEEA7C", }, ], }, "Type": "AWS::IAM::Policy", }, "PipelineRoleD68726F7": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "codepipeline.amazonaws.com", }, }, ], "Version": "2012-10-17", }, }, "Type": "AWS::IAM::Role", }, "PipelineRoleDefaultPolicyC7A05455": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": Array [ "s3:GetObject*", "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", "s3:PutObject", "s3:PutObjectLegalHold", "s3:PutObjectRetention", "s3:PutObjectTagging", "s3:PutObjectVersionTagging", "s3:Abort*", ], "Effect": "Allow", "Resource": Array [ Object { "Fn::GetAtt": Array [ "PipelineArtifactsBucket22248F97", "Arn", ], }, Object { "Fn::Join": Array [ "", Array [ Object { "Fn::GetAtt": Array [ "PipelineArtifactsBucket22248F97", "Arn", ], }, "/*", ], ], }, ], }, Object { "Action": Array [ "kms:Decrypt", "kms:DescribeKey", "kms:Encrypt", "kms:ReEncrypt*", "kms:GenerateDataKey*", ], "Effect": "Allow", "Resource": Object { "Fn::GetAtt": Array [ "PipelineArtifactsBucketEncryptionKey01D58D69", "Arn", ], }, }, Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Resource": Object { "Fn::GetAtt": Array [ "PipelineSourceCodePipelineActionRoleC6F9E7F5", "Arn", ], }, }, Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Resource": Object { "Fn::GetAtt": Array [ "PipelineBuildCodePipelineActionRoleD77A08E6", "Arn", ], }, }, Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Resource": Object { "Fn::GetAtt": Array [ "PipelineDeployCodePipelineActionRole8B83082E", "Arn", ], }, }, ], "Version": "2012-10-17", }, "PolicyName": "PipelineRoleDefaultPolicyC7A05455", "Roles": Array [ Object { "Ref": "PipelineRoleD68726F7", }, ], }, "Type": "AWS::IAM::Policy", }, "PipelineSourceCodePipelineActionRoleC6F9E7F5": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "AWS": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::", Object { "Ref": "AWS::AccountId", }, ":root", ], ], }, }, }, ], "Version": "2012-10-17", }, }, "Type": "AWS::IAM::Role", }, "PipelineSourceCodePipelineActionRoleDefaultPolicy2D565925": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": Array [ "s3:GetObject*", "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", "s3:PutObject", "s3:PutObjectLegalHold", "s3:PutObjectRetention", "s3:PutObjectTagging", "s3:PutObjectVersionTagging", "s3:Abort*", ], "Effect": "Allow", "Resource": Array [ Object { "Fn::GetAtt": Array [ "PipelineArtifactsBucket22248F97", "Arn", ], }, Object { "Fn::Join": Array [ "", Array [ Object { "Fn::GetAtt": Array [ "PipelineArtifactsBucket22248F97", "Arn", ], }, "/*", ], ], }, ], }, Object { "Action": Array [ "kms:Decrypt", "kms:DescribeKey", "kms:Encrypt", "kms:ReEncrypt*", "kms:GenerateDataKey*", ], "Effect": "Allow", "Resource": Object { "Fn::GetAtt": Array [ "PipelineArtifactsBucketEncryptionKey01D58D69", "Arn", ], }, }, Object { "Action": Array [ "codecommit:GetBranch", "codecommit:GetCommit", "codecommit:UploadArchive", "codecommit:GetUploadArchiveStatus", "codecommit:CancelUploadArchive", ], "Effect": "Allow", "Resource": Object { "Fn::GetAtt": Array [ "Repo02AC86CF", "Arn", ], }, }, ], "Version": "2012-10-17", }, "PolicyName": "PipelineSourceCodePipelineActionRoleDefaultPolicy2D565925", "Roles": Array [ Object { "Ref": "PipelineSourceCodePipelineActionRoleC6F9E7F5", }, ], }, "Type": "AWS::IAM::Policy", }, "Repo02AC86CF": Object { "DependsOn": Array [ "BuildProject097C5DB7", "BuildProjectRoleDefaultPolicy3E9F248C", "BuildProjectRoleAA92C755", "Key961B73FD", ], "Properties": Object { "RepositoryName": "my-first-decdk-repo", }, "Type": "AWS::CodeCommit::Repository", }, "RepoTestPipeline9942903CEventRule83B9BC8D": Object { "DependsOn": Array [ "BuildProject097C5DB7", "BuildProjectRoleDefaultPolicy3E9F248C", "BuildProjectRoleAA92C755", "Key961B73FD", ], "Properties": Object { "EventPattern": Object { "detail": Object { "event": Array [ "referenceCreated", "referenceUpdated", ], "referenceName": Array [ "master", ], }, "detail-type": Array [ "CodeCommit Repository State Change", ], "resources": Array [ Object { "Fn::GetAtt": Array [ "Repo02AC86CF", "Arn", ], }, ], "source": Array [ "aws.codecommit", ], }, "State": "ENABLED", "Targets": Array [ Object { "Arn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":codepipeline:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "PipelineC660917D", }, ], ], }, "Id": "Target0", "RoleArn": Object { "Fn::GetAtt": Array [ "PipelineEventsRole46BEEA7C", "Arn", ], }, }, ], }, "Type": "AWS::Events::Rule", }, }, } `; exports[`Evaluation Valid templates examples/static-site.yaml 1`] = ` Object { "Mappings": Object { "AWSCloudFrontPartitionHostedZoneIdMap": Object { "aws": Object { "zoneId": "Z2FDTNDATAQYW2", }, "aws-cn": Object { "zoneId": "Z3RFFRIM2A3IF5", }, }, }, "Parameters": Object { "DomainName": Object { "Default": "www.example.com", "Type": "String", }, "HostedZoneId": Object { "Type": "String", }, }, "Resources": Object { "CloudFrontOAI9EBF49FD": Object { "Properties": Object { "CloudFrontOriginAccessIdentityConfig": Object { "Comment": Object { "Fn::Join": Array [ " ", Array [ "OAI for", Object { "Ref": "DomainName", }, ], ], }, }, }, "Type": "AWS::CloudFront::CloudFrontOriginAccessIdentity", }, "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536": Object { "DependsOn": Array [ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF", "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265", ], "Properties": Object { "Code": Object { "S3Bucket": Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd.zip", }, "Environment": Object { "Variables": Object { "AWS_CA_BUNDLE": "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem", }, }, "Handler": "index.handler", "Layers": Array [ Object { "Ref": "SiteDeploymentAwsCliLayerADBDEF4E", }, ], "Role": Object { "Fn::GetAtt": Array [ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265", "Arn", ], }, "Runtime": "python3.9", "Timeout": 900, }, "Type": "AWS::Lambda::Function", }, "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": Array [ "s3:GetObject*", "s3:GetBucket*", "s3:List*", ], "Effect": "Allow", "Resource": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":s3:::", Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, ], ], }, Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":s3:::", Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "/*", ], ], }, ], }, Object { "Action": Array [ "s3:GetObject*", "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", "s3:PutObject", "s3:PutObjectLegalHold", "s3:PutObjectRetention", "s3:PutObjectTagging", "s3:PutObjectVersionTagging", "s3:Abort*", ], "Effect": "Allow", "Resource": Array [ Object { "Fn::GetAtt": Array [ "SiteBucket397A1860", "Arn", ], }, Object { "Fn::Join": Array [ "", Array [ Object { "Fn::GetAtt": Array [ "SiteBucket397A1860", "Arn", ], }, "/*", ], ], }, ], }, Object { "Action": Array [ "cloudfront:GetInvalidation", "cloudfront:CreateInvalidation", ], "Effect": "Allow", "Resource": "*", }, ], "Version": "2012-10-17", }, "PolicyName": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF", "Roles": Array [ Object { "Ref": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265", }, ], }, "Type": "AWS::IAM::Policy", }, "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F": Object { "DependsOn": Array [ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092", ], "Properties": Object { "Code": Object { "S3Bucket": Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "a657308e723bb9460b800cb3b47dadb74e28243edfe246bf7755c45ec312eb97.zip", }, "Description": Object { "Fn::Join": Array [ "", Array [ "Lambda function for auto-deleting objects in ", Object { "Ref": "SiteBucket397A1860", }, " S3 bucket.", ], ], }, "Handler": "index.handler", "MemorySize": 128, "Role": Object { "Fn::GetAtt": Array [ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092", "Arn", ], }, "Runtime": "nodejs18.x", "Timeout": 900, }, "Type": "AWS::Lambda::Function", }, "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Sub": "arn:\${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", }, ], }, "Type": "AWS::IAM::Role", }, "SiteAliasRecord3C0AF5BF": Object { "Properties": Object { "AliasTarget": Object { "DNSName": Object { "Fn::GetAtt": Array [ "SiteDistribution3FF9535D", "DomainName", ], }, "HostedZoneId": Object { "Fn::FindInMap": Array [ "AWSCloudFrontPartitionHostedZoneIdMap", Object { "Ref": "AWS::Partition", }, "zoneId", ], }, }, "HostedZoneId": Object { "Ref": "HostedZoneId", }, "Name": Object { "Fn::Join": Array [ "", Array [ "www.", Object { "Ref": "DomainName", }, ".", ], ], }, "Type": "A", }, "Type": "AWS::Route53::RecordSet", }, "SiteBucket397A1860": Object { "DeletionPolicy": "Delete", "Properties": Object { "PublicAccessBlockConfiguration": Object { "BlockPublicAcls": true, "BlockPublicPolicy": true, "IgnorePublicAcls": true, "RestrictPublicBuckets": true, }, "Tags": Array [ Object { "Key": "aws-cdk:auto-delete-objects", "Value": "true", }, Object { "Key": "aws-cdk:cr-owned:01b9357c", "Value": "true", }, ], }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "SiteBucketAutoDeleteObjectsCustomResource9585E968": Object { "DeletionPolicy": "Delete", "DependsOn": Array [ "SiteBucketPolicy3AC1D0F8", ], "Properties": Object { "BucketName": Object { "Ref": "SiteBucket397A1860", }, "ServiceToken": Object { "Fn::GetAtt": Array [ "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F", "Arn", ], }, }, "Type": "Custom::S3AutoDeleteObjects", "UpdateReplacePolicy": "Delete", }, "SiteBucketPolicy3AC1D0F8": Object { "Properties": Object { "Bucket": Object { "Ref": "SiteBucket397A1860", }, "PolicyDocument": Object { "Statement": Array [ Object { "Action": Array [ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", ], "Effect": "Allow", "Principal": Object { "AWS": Object { "Fn::GetAtt": Array [ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092", "Arn", ], }, }, "Resource": Array [ Object { "Fn::GetAtt": Array [ "SiteBucket397A1860", "Arn", ], }, Object { "Fn::Join": Array [ "", Array [ Object { "Fn::GetAtt": Array [ "SiteBucket397A1860", "Arn", ], }, "/*", ], ], }, ], }, Object { "Action": Array [ "s3:GetObject*", "s3:GetBucket*", "s3:List*", ], "Effect": "Allow", "Principal": Object { "CanonicalUser": Object { "Fn::GetAtt": Array [ "CloudFrontOAI9EBF49FD", "S3CanonicalUserId", ], }, }, "Resource": Array [ Object { "Fn::GetAtt": Array [ "SiteBucket397A1860", "Arn", ], }, Object { "Fn::Join": Array [ "", Array [ Object { "Fn::GetAtt": Array [ "SiteBucket397A1860", "Arn", ], }, "/*", ], ], }, ], }, Object { "Action": "s3:GetObject", "Effect": "Allow", "Principal": Object { "CanonicalUser": Object { "Fn::GetAtt": Array [ "CloudFrontOAI9EBF49FD", "S3CanonicalUserId", ], }, }, "Resource": Object { "Fn::Join": Array [ "", Array [ Object { "Fn::GetAtt": Array [ "SiteBucket397A1860", "Arn", ], }, "/*", ], ], }, }, ], "Version": "2012-10-17", }, }, "Type": "AWS::S3::BucketPolicy", }, "SiteCertificateCertificateRequestorFunction7CFA7DEA": Object { "DependsOn": Array [ "SiteCertificateCertificateRequestorFunctionServiceRoleDefaultPolicy96ED5C9C", "SiteCertificateCertificateRequestorFunctionServiceRole645E891D", ], "Properties": Object { "Code": Object { "S3Bucket": Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "d4c47643615e33c32aac58169698a692fa1d1f3e0da0dd6c4bf1c0e6af68d757.zip", }, "Handler": "index.certificateRequestHandler", "Role": Object { "Fn::GetAtt": Array [ "SiteCertificateCertificateRequestorFunctionServiceRole645E891D", "Arn", ], }, "Runtime": "nodejs18.x", "Timeout": 900, }, "Type": "AWS::Lambda::Function", }, "SiteCertificateCertificateRequestorFunctionServiceRole645E891D": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "SiteCertificateCertificateRequestorFunctionServiceRoleDefaultPolicy96ED5C9C": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": Array [ "acm:RequestCertificate", "acm:DescribeCertificate", "acm:DeleteCertificate", "acm:AddTagsToCertificate", ], "Effect": "Allow", "Resource": "*", }, Object { "Action": "route53:GetChange", "Effect": "Allow", "Resource": "*", }, Object { "Action": "route53:changeResourceRecordSets", "Condition": Object { "ForAllValues:StringEquals": Object { "route53:ChangeResourceRecordSetsActions": Array [ "UPSERT", ], "route53:ChangeResourceRecordSetsRecordTypes": Array [ "CNAME", ], }, "ForAllValues:StringLike": Object { "route53:ChangeResourceRecordSetsNormalizedRecordNames": Array [ Object { "Fn::Join": Array [ "", Array [ "*.", Object { "Ref": "DomainName", }, ], ], }, ], }, }, "Effect": "Allow", "Resource": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":route53:::hostedzone/", Object { "Ref": "HostedZoneId", }, ], ], }, }, ], "Version": "2012-10-17", }, "PolicyName": "SiteCertificateCertificateRequestorFunctionServiceRoleDefaultPolicy96ED5C9C", "Roles": Array [ Object { "Ref": "SiteCertificateCertificateRequestorFunctionServiceRole645E891D", }, ], }, "Type": "AWS::IAM::Policy", }, "SiteCertificateCertificateRequestorResource6021082A": Object { "DeletionPolicy": "Delete", "Properties": Object { "DomainName": Object { "Ref": "DomainName", }, "HostedZoneId": Object { "Ref": "HostedZoneId", }, "Region": Object { "Ref": "AWS::Region", }, "ServiceToken": Object { "Fn::GetAtt": Array [ "SiteCertificateCertificateRequestorFunction7CFA7DEA", "Arn", ], }, }, "Type": "AWS::CloudFormation::CustomResource", "UpdateReplacePolicy": "Delete", }, "SiteDeploymentAwsCliLayerADBDEF4E": Object { "Properties": Object { "Content": Object { "S3Bucket": Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", }, "Description": "/opt/awscli/aws", }, "Type": "AWS::Lambda::LayerVersion", }, "SiteDeploymentCustomResource42D55606": Object { "DeletionPolicy": "Delete", "Properties": Object { "DestinationBucketName": Object { "Ref": "SiteBucket397A1860", }, "DistributionId": Object { "Ref": "SiteDistribution3FF9535D", }, "DistributionPaths": Array [ "/*", ], "Prune": true, "ServiceToken": Object { "Fn::GetAtt": Array [ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536", "Arn", ], }, "SourceBucketNames": Array [ Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, ], "SourceMarkers": Array [ Object { "<>": Object { "Ref": "DomainName", }, }, Object {}, ], "SourceObjectKeys": Array [ "6e25d8f9552b045850ef3f54f980ae2ae9bb305835d911fc6d0106baa23012a6.zip", "01d8bb8741bd21881297aae74e844ad4a0cda03111cb443074438bb2fa068d44.zip", ], }, "Type": "Custom::CDKBucketDeployment", "UpdateReplacePolicy": "Delete", }, "SiteDistribution3FF9535D": Object { "Properties": Object { "DistributionConfig": Object { "Aliases": Array [ Object { "Ref": "DomainName", }, ], "CustomErrorResponses": Array [ Object { "ErrorCachingMinTTL": 1800, "ErrorCode": 403, "ResponseCode": 403, "ResponsePagePath": "error.html", }, ], "DefaultCacheBehavior": Object { "CachePolicyId": "658327ea-f89d-4fab-a63d-7e88639e58f6", "Compress": true, "TargetOriginId": "TestSiteDistributionOrigin1997BC5BD", "ViewerProtocolPolicy": "allow-all", }, "DefaultRootObject": "index.html", "Enabled": true, "HttpVersion": "http2", "IPV6Enabled": true, "Origins": Array [ Object { "DomainName": Object { "Fn::GetAtt": Array [ "SiteBucket397A1860", "RegionalDomainName", ], }, "Id": "TestSiteDistributionOrigin1997BC5BD", "S3OriginConfig": Object { "OriginAccessIdentity": Object { "Fn::Join": Array [ "", Array [ "origin-access-identity/cloudfront/", Object { "Ref": "CloudFrontOAI9EBF49FD", }, ], ], }, }, }, ], "ViewerCertificate": Object { "AcmCertificateArn": Object { "Fn::GetAtt": Array [ "SiteCertificateCertificateRequestorResource6021082A", "Arn", ], }, "MinimumProtocolVersion": "TLSv1.2_2021", "SslSupportMethod": "sni-only", }, }, }, "Type": "AWS::CloudFront::Distribution", }, }, } `; exports[`Evaluation Valid templates examples/vpc.json 1`] = ` Object { "Resources": Object { "VPCB9E5F0B4": Object { "Properties": Object { "CidrBlock": "10.0.0.0/16", "EnableDnsHostnames": true, "EnableDnsSupport": true, "InstanceTenancy": "default", "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC", }, ], }, "Type": "AWS::EC2::VPC", }, "VPCIGWB7E252D3": Object { "Properties": Object { "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC", }, ], }, "Type": "AWS::EC2::InternetGateway", }, "VPCPrivateSubnet1DefaultRouteAE1D6490": Object { "Properties": Object { "DestinationCidrBlock": "0.0.0.0/0", "NatGatewayId": Object { "Ref": "VPCPublicSubnet1NATGatewayE0556630", }, "RouteTableId": Object { "Ref": "VPCPrivateSubnet1RouteTableBE8A6027", }, }, "Type": "AWS::EC2::Route", }, "VPCPrivateSubnet1RouteTableAssociation347902D1": Object { "Properties": Object { "RouteTableId": Object { "Ref": "VPCPrivateSubnet1RouteTableBE8A6027", }, "SubnetId": Object { "Ref": "VPCPrivateSubnet1Subnet8BCA10E0", }, }, "Type": "AWS::EC2::SubnetRouteTableAssociation", }, "VPCPrivateSubnet1RouteTableBE8A6027": Object { "Properties": Object { "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC/PrivateSubnet1", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::RouteTable", }, "VPCPrivateSubnet1Subnet8BCA10E0": Object { "Properties": Object { "AvailabilityZone": Object { "Fn::Select": Array [ 0, Object { "Fn::GetAZs": "", }, ], }, "CidrBlock": "10.0.128.0/18", "MapPublicIpOnLaunch": false, "Tags": Array [ Object { "Key": "aws-cdk:subnet-name", "Value": "Private", }, Object { "Key": "aws-cdk:subnet-type", "Value": "Private", }, Object { "Key": "Name", "Value": "Test/VPC/PrivateSubnet1", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::Subnet", }, "VPCPrivateSubnet2DefaultRouteF4F5CFD2": Object { "Properties": Object { "DestinationCidrBlock": "0.0.0.0/0", "NatGatewayId": Object { "Ref": "VPCPublicSubnet2NATGateway3C070193", }, "RouteTableId": Object { "Ref": "VPCPrivateSubnet2RouteTable0A19E10E", }, }, "Type": "AWS::EC2::Route", }, "VPCPrivateSubnet2RouteTable0A19E10E": Object { "Properties": Object { "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC/PrivateSubnet2", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::RouteTable", }, "VPCPrivateSubnet2RouteTableAssociation0C73D413": Object { "Properties": Object { "RouteTableId": Object { "Ref": "VPCPrivateSubnet2RouteTable0A19E10E", }, "SubnetId": Object { "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A", }, }, "Type": "AWS::EC2::SubnetRouteTableAssociation", }, "VPCPrivateSubnet2SubnetCFCDAA7A": Object { "Properties": Object { "AvailabilityZone": Object { "Fn::Select": Array [ 1, Object { "Fn::GetAZs": "", }, ], }, "CidrBlock": "10.0.192.0/18", "MapPublicIpOnLaunch": false, "Tags": Array [ Object { "Key": "aws-cdk:subnet-name", "Value": "Private", }, Object { "Key": "aws-cdk:subnet-type", "Value": "Private", }, Object { "Key": "Name", "Value": "Test/VPC/PrivateSubnet2", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::Subnet", }, "VPCPublicSubnet1DefaultRoute91CEF279": Object { "DependsOn": Array [ "VPCVPCGW99B986DC", ], "Properties": Object { "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": Object { "Ref": "VPCIGWB7E252D3", }, "RouteTableId": Object { "Ref": "VPCPublicSubnet1RouteTableFEE4B781", }, }, "Type": "AWS::EC2::Route", }, "VPCPublicSubnet1EIP6AD938E8": Object { "Properties": Object { "Domain": "vpc", "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC/PublicSubnet1", }, ], }, "Type": "AWS::EC2::EIP", }, "VPCPublicSubnet1NATGatewayE0556630": Object { "DependsOn": Array [ "VPCPublicSubnet1DefaultRoute91CEF279", "VPCPublicSubnet1RouteTableAssociation0B0896DC", ], "Properties": Object { "AllocationId": Object { "Fn::GetAtt": Array [ "VPCPublicSubnet1EIP6AD938E8", "AllocationId", ], }, "SubnetId": Object { "Ref": "VPCPublicSubnet1SubnetB4246D30", }, "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC/PublicSubnet1", }, ], }, "Type": "AWS::EC2::NatGateway", }, "VPCPublicSubnet1RouteTableAssociation0B0896DC": Object { "Properties": Object { "RouteTableId": Object { "Ref": "VPCPublicSubnet1RouteTableFEE4B781", }, "SubnetId": Object { "Ref": "VPCPublicSubnet1SubnetB4246D30", }, }, "Type": "AWS::EC2::SubnetRouteTableAssociation", }, "VPCPublicSubnet1RouteTableFEE4B781": Object { "Properties": Object { "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC/PublicSubnet1", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::RouteTable", }, "VPCPublicSubnet1SubnetB4246D30": Object { "Properties": Object { "AvailabilityZone": Object { "Fn::Select": Array [ 0, Object { "Fn::GetAZs": "", }, ], }, "CidrBlock": "10.0.0.0/18", "MapPublicIpOnLaunch": true, "Tags": Array [ Object { "Key": "aws-cdk:subnet-name", "Value": "Public", }, Object { "Key": "aws-cdk:subnet-type", "Value": "Public", }, Object { "Key": "Name", "Value": "Test/VPC/PublicSubnet1", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::Subnet", }, "VPCPublicSubnet2DefaultRouteB7481BBA": Object { "DependsOn": Array [ "VPCVPCGW99B986DC", ], "Properties": Object { "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": Object { "Ref": "VPCIGWB7E252D3", }, "RouteTableId": Object { "Ref": "VPCPublicSubnet2RouteTable6F1A15F1", }, }, "Type": "AWS::EC2::Route", }, "VPCPublicSubnet2EIP4947BC00": Object { "Properties": Object { "Domain": "vpc", "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC/PublicSubnet2", }, ], }, "Type": "AWS::EC2::EIP", }, "VPCPublicSubnet2NATGateway3C070193": Object { "DependsOn": Array [ "VPCPublicSubnet2DefaultRouteB7481BBA", "VPCPublicSubnet2RouteTableAssociation5A808732", ], "Properties": Object { "AllocationId": Object { "Fn::GetAtt": Array [ "VPCPublicSubnet2EIP4947BC00", "AllocationId", ], }, "SubnetId": Object { "Ref": "VPCPublicSubnet2Subnet74179F39", }, "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC/PublicSubnet2", }, ], }, "Type": "AWS::EC2::NatGateway", }, "VPCPublicSubnet2RouteTable6F1A15F1": Object { "Properties": Object { "Tags": Array [ Object { "Key": "Name", "Value": "Test/VPC/PublicSubnet2", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::RouteTable", }, "VPCPublicSubnet2RouteTableAssociation5A808732": Object { "Properties": Object { "RouteTableId": Object { "Ref": "VPCPublicSubnet2RouteTable6F1A15F1", }, "SubnetId": Object { "Ref": "VPCPublicSubnet2Subnet74179F39", }, }, "Type": "AWS::EC2::SubnetRouteTableAssociation", }, "VPCPublicSubnet2Subnet74179F39": Object { "Properties": Object { "AvailabilityZone": Object { "Fn::Select": Array [ 1, Object { "Fn::GetAZs": "", }, ], }, "CidrBlock": "10.0.64.0/18", "MapPublicIpOnLaunch": true, "Tags": Array [ Object { "Key": "aws-cdk:subnet-name", "Value": "Public", }, Object { "Key": "aws-cdk:subnet-type", "Value": "Public", }, Object { "Key": "Name", "Value": "Test/VPC/PublicSubnet2", }, ], "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::Subnet", }, "VPCVPCGW99B986DC": Object { "Properties": Object { "InternetGatewayId": Object { "Ref": "VPCIGWB7E252D3", }, "VpcId": Object { "Ref": "VPCB9E5F0B4", }, }, "Type": "AWS::EC2::VPCGatewayAttachment", }, }, } `; exports[`Evaluation Valid templates templates/cfn-complex-template.json 1`] = ` Object { "AWSTemplateFormatVersion": "2010-09-09", "Conditions": Object { "UseALBSSL": Object { "Fn::Not": Array [ Object { "Fn::Equals": Array [ Object { "Ref": "UseSSL", }, "Yes", ], }, ], }, }, "Description": "AWS CloudFormation Sample Template for using Assertions: Create a load balanced, Auto Scaled sample website where the instances are locked down to only accept traffic from the load balancer. This example creates an Auto Scaling group behind a load balancer with a health check. The web site is available on port 80 or 443 based on the input.", "Mappings": Object { "AWSAMIRegionMap": Object { "AMI": Object { "AMZNLINUXHVM": "amzn-ami-hvm-2017.09.1.20171120-x86_64-gp2", }, "ap-northeast-1": Object { "AMZNLINUXHVM": "ami-da9e2cbc", }, "ap-northeast-2": Object { "AMZNLINUXHVM": "ami-1196317f", }, "ap-south-1": Object { "AMZNLINUXHVM": "ami-d5c18eba", }, "ap-southeast-1": Object { "AMZNLINUXHVM": "ami-c63d6aa5", }, "ap-southeast-2": Object { "AMZNLINUXHVM": "ami-ff4ea59d", }, "ca-central-1": Object { "AMZNLINUXHVM": "ami-d29e25b6", }, "eu-central-1": Object { "AMZNLINUXHVM": "ami-bf2ba8d0", }, "eu-west-1": Object { "AMZNLINUXHVM": "ami-1a962263", }, "eu-west-2": Object { "AMZNLINUXHVM": "ami-e7d6c983", }, "sa-east-1": Object { "AMZNLINUXHVM": "ami-286f2a44", }, "us-east-1": Object { "AMZNLINUXHVM": "ami-55ef662f", }, "us-east-2": Object { "AMZNLINUXHVM": "ami-15e9c770", }, "us-west-1": Object { "AMZNLINUXHVM": "ami-a51f27c5", }, "us-west-2": Object { "AMZNLINUXHVM": "ami-bf4193c7", }, }, }, "Outputs": Object { "URL": Object { "Description": "URL of the website", "Value": Object { "Fn::If": Array [ "UseALBSSL", Object { "Fn::Join": Array [ "", Array [ "https://", Object { "Fn::Select": Array [ "0", Object { "Fn::Split": Array [ ".", Object { "Fn::GetAtt": Array [ "ApplicationLoadBalancer", "DNSName", ], }, ], }, ], }, ".", Object { "Ref": "HostedZoneName", }, ".", ], ], }, Object { "Fn::Join": Array [ "", Array [ "http://", Object { "Fn::GetAtt": Array [ "ApplicationLoadBalancer", "DNSName", ], }, ], ], }, ], }, }, }, "Parameters": Object { "ALBSSLCertificateARN": Object { "Default": "", "Description": "[Optional] The ARN of the SSL certificate to be used for the Application Load Balancer", "Type": "String", }, "HostedZoneName": Object { "AllowedPattern": "^$|(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\\\-]*[a-zA-Z0-9])\\\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\\\-]*[A-Za-z0-9])$", "Default": "", "Description": "[Optional] The domain name of a valid Hosted Zone on AWS.", "Type": "String", }, "InstanceType": Object { "AllowedValues": Array [ "t2.nano", "t2.micro", "t2.small", "t2.medium", "t2.large", "m4.large", "m4.xlarge", "m4.2xlarge", "m4.4xlarge", "m4.10xlarge", "m3.medium", "m3.large", "m3.xlarge", "m3.2xlarge", "c4.large", "c4.xlarge", "c4.2xlarge", "c4.4xlarge", "c4.8xlarge", "c3.large", "c3.xlarge", "c3.2xlarge", "c3.4xlarge", "c3.8xlarge", "r3.large", "r3.xlarge", ], "ConstraintDescription": "must be a valid EC2 instance type.", "Default": "t2.small", "Description": "WebServer EC2 instance type", "Type": "String", }, "KeyName": Object { "ConstraintDescription": "must be the name of an existing EC2 KeyPair.", "Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances", "Type": "AWS::EC2::KeyPair::KeyName", }, "MarkdownText": Object { "Default": "# Hello world", "Type": "String", }, "SSHLocation": Object { "AllowedPattern": "(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})/(\\\\d{1,2})", "ConstraintDescription": "must be a valid IP CIDR range of the form x.x.x.x/x.", "Default": "0.0.0.0/0", "Description": "The IP address range that can be used to SSH to the EC2 instances", "MaxLength": 18, "MinLength": 9, "Type": "String", }, "Subnets": Object { "ConstraintDescription": "must be a list of at least two existing subnets associated with at least two different availability zones. They should be residing in the selected Virtual Private Cloud.", "Description": "The list of SubnetIds in your Virtual Private Cloud (VPC)", "Type": "List", }, "UseSSL": Object { "AllowedValues": Array [ "Yes", "No", ], "ConstraintDescription": "Select Yes to create a HTTPS Listener", "Default": "No", "Description": "Select \\"Yes\\" to implement SSL, \\"No\\" to skip (default).", "Type": "String", }, "VpcId": Object { "ConstraintDescription": "must be the VPC Id of an existing Virtual Private Cloud.", "Description": "VpcId of your existing Virtual Private Cloud (VPC)", "Type": "AWS::EC2::VPC::Id", }, }, "Resources": Object { "ALBListener": Object { "DeletionPolicy": "Delete", "Properties": Object { "Certificates": Array [ Object { "Fn::If": Array [ "UseALBSSL", Object { "CertificateArn": Object { "Ref": "ALBSSLCertificateARN", }, }, Object { "Ref": "AWS::NoValue", }, ], }, ], "DefaultActions": Array [ Object { "TargetGroupArn": Object { "Ref": "ALBTargetGroup", }, "Type": "forward", }, ], "LoadBalancerArn": Object { "Ref": "ApplicationLoadBalancer", }, "Port": Object { "Fn::If": Array [ "UseALBSSL", 443, 80, ], }, "Protocol": Object { "Fn::If": Array [ "UseALBSSL", "HTTPS", "HTTP", ], }, }, "Type": "AWS::ElasticLoadBalancingV2::Listener", "UpdateReplacePolicy": "Delete", }, "ALBTargetGroup": Object { "DeletionPolicy": "Delete", "Properties": Object { "HealthCheckIntervalSeconds": 30, "HealthCheckTimeoutSeconds": 5, "HealthyThresholdCount": 3, "Port": 80, "Protocol": "HTTP", "UnhealthyThresholdCount": 5, "VpcId": Object { "Ref": "VpcId", }, }, "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", "UpdateReplacePolicy": "Delete", }, "ApplicationLoadBalancer": Object { "DeletionPolicy": "Delete", "Properties": Object { "SecurityGroups": Array [ Object { "Ref": "ELBSecurityGroup", }, ], "Subnets": Object { "Ref": "Subnets", }, }, "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", "UpdateReplacePolicy": "Delete", }, "Dashboard": Object { "DeletionPolicy": "Delete", "Properties": Object { "DashboardBody": Object { "Fn::Join": Array [ "", Array [ "{\\"start\\":\\"-PT6H\\",\\"periodOverride\\":\\"inherit\\",\\"widgets\\":[{\\"type\\":\\"text\\",\\"x\\":0,\\"y\\":7,\\"width\\":3,\\"height\\":", Object { "Fn::Length": Object { "Ref": "Subnets", }, }, ",\\"properties\\":{\\"markdown\\":{\\"Fn::Ref\\":\\"MarkdownText\\"}}}]}", ], ], }, }, "Type": "AWS::CloudWatch::Dashboard", "UpdateReplacePolicy": "Delete", }, "ELBSecurityGroup": Object { "DeletionPolicy": "Delete", "Properties": Object { "GroupDescription": "Allow access to the ELB", "SecurityGroupIngress": Array [ Object { "Fn::If": Array [ "UseALBSSL", Object { "CidrIp": "0.0.0.0/0", "FromPort": 443, "IpProtocol": "tcp", "ToPort": 443, }, Object { "CidrIp": "0.0.0.0/0", "FromPort": 80, "IpProtocol": "tcp", "ToPort": 80, }, ], }, ], "VpcId": Object { "Ref": "VpcId", }, }, "Type": "AWS::EC2::SecurityGroup", "UpdateReplacePolicy": "Delete", }, "InstanceSecurityGroup": Object { "DeletionPolicy": "Delete", "Properties": Object { "GroupDescription": "Enable SSH access and HTTP access on the inbound port", "SecurityGroupIngress": Array [ Object { "FromPort": 80, "IpProtocol": "tcp", "SourceSecurityGroupId": Object { "Fn::Select": Array [ 0, Object { "Fn::GetAtt": Array [ "ApplicationLoadBalancer", "SecurityGroups", ], }, ], }, "ToPort": 80, }, Object { "CidrIp": Object { "Ref": "SSHLocation", }, "FromPort": 22, "IpProtocol": "tcp", "ToPort": 22, }, ], "VpcId": Object { "Ref": "VpcId", }, }, "Type": "AWS::EC2::SecurityGroup", "UpdateReplacePolicy": "Delete", }, "LaunchConfig": Object { "DeletionPolicy": "Delete", "Metadata": Object { "AWS::CloudFormation::Init": Object { "config": Object { "files": Object { "/etc/cfn/cfn-hup.conf": Object { "content": Object { "Fn::Join": Array [ "", Array [ "[main] ", "stack=", Object { "Ref": "AWS::StackId", }, " ", "region=", Object { "Ref": "AWS::Region", }, " ", ], ], }, "group": "root", "mode": "000400", "owner": "root", }, "/etc/cfn/hooks.d/cfn-auto-reloader.conf": Object { "content": Object { "Fn::Join": Array [ "", Array [ "[cfn-auto-reloader-hook] ", "triggers=post.update ", "path=Resources.LaunchConfig.Metadata.AWS::CloudFormation::Init ", "action=/opt/aws/bin/cfn-init -v ", " --stack ", Object { "Ref": "AWS::StackName", }, " --resource LaunchConfig ", " --region ", Object { "Ref": "AWS::Region", }, " ", "runas=root ", ], ], }, "group": "root", "mode": "000400", "owner": "root", }, "/var/www/html/index.html": Object { "content": Object { "Fn::Join": Array [ " ", Array [ "

Congratulations, you have successfully launched the AWS CloudFormation sample.

", ], ], }, "group": "root", "mode": "000644", "owner": "root", }, }, "packages": Object { "yum": Object { "httpd": Array [], }, }, "services": Object { "sysvinit": Object { "cfn-hup": Object { "enabled": "true", "ensureRunning": "true", "files": Array [ "/etc/cfn/cfn-hup.conf", "/etc/cfn/hooks.d/cfn-auto-reloader.conf", ], }, "httpd": Object { "enabled": "true", "ensureRunning": "true", }, }, }, }, }, "Comment": "Install a simple application", }, "Properties": Object { "ImageId": Object { "Fn::FindInMap": Array [ "AWSAMIRegionMap", Object { "Ref": "AWS::Region", }, "AMZNLINUXHVM", ], }, "InstanceType": Object { "Ref": "InstanceType", }, "KeyName": Object { "Ref": "KeyName", }, "SecurityGroups": Array [ Object { "Ref": "InstanceSecurityGroup", }, ], "UserData": Object { "Fn::Base64": Object { "Fn::Join": Array [ "", Array [ "#!/bin/bash -xe yum update -y aws-cfn-bootstrap /opt/aws/bin/cfn-init -v --stack ", Object { "Ref": "AWS::StackName", }, " --resource LaunchConfig --region ", Object { "Ref": "AWS::Region", }, " /opt/aws/bin/cfn-signal -e $? --stack ", Object { "Ref": "AWS::StackName", }, " --resource WebServerGroup --region ", Object { "Ref": "AWS::Region", }, " ", ], ], }, }, }, "Type": "AWS::AutoScaling::LaunchConfiguration", "UpdateReplacePolicy": "Delete", }, "RecordSet": Object { "DeletionPolicy": "Delete", "Properties": Object { "HostedZoneName": Object { "Fn::Join": Array [ "", Array [ Object { "Ref": "HostedZoneName", }, ".", ], ], }, "RecordSets": Array [ Object { "AliasTarget": Object { "DNSName": Object { "Fn::GetAtt": Array [ "ApplicationLoadBalancer", "DNSName", ], }, "EvaluateTargetHealth": true, "HostedZoneId": Object { "Fn::GetAtt": Array [ "ApplicationLoadBalancer", "CanonicalHostedZoneID", ], }, }, "Name": Object { "Fn::Join": Array [ "", Array [ Object { "Fn::Select": Array [ "0", Object { "Fn::Split": Array [ ".", Object { "Fn::GetAtt": Array [ "ApplicationLoadBalancer", "DNSName", ], }, ], }, ], }, ".", Object { "Ref": "HostedZoneName", }, ".", ], ], }, "Type": "A", }, ], }, "Type": "AWS::Route53::RecordSetGroup", "UpdateReplacePolicy": "Delete", }, "WebServerGroup": Object { "CreationPolicy": Object { "ResourceSignal": Object { "Timeout": "PT15M", }, }, "DeletionPolicy": "Delete", "Properties": Object { "LaunchConfigurationName": Object { "Ref": "LaunchConfig", }, "MaxSize": "2", "MinSize": "2", "TargetGroupARNs": Array [ Object { "Ref": "ALBTargetGroup", }, ], "VPCZoneIdentifier": Object { "Ref": "Subnets", }, }, "Type": "AWS::AutoScaling::AutoScalingGroup", "UpdatePolicy": Object { "AutoScalingRollingUpdate": Object { "MaxBatchSize": "1", "MinInstancesInService": "1", "PauseTime": "PT15M", "WaitOnResourceSignals": "true", }, }, "UpdateReplacePolicy": "Delete", }, }, "Rules": Object { "SubnetsInVPC": Object { "Assertions": Array [ Object { "Assert": Object { "Fn::EachMemberEquals": Array [ Object { "Fn::ValueOf": Array [ "Subnets", "VpcId", ], }, Object { "Ref": "VpcId", }, ], }, "AssertDescription": "All subnets must in the VPC", }, ], }, "ValidateHostedZone": Object { "Assertions": Array [ Object { "Assert": Object { "Fn::Not": Array [ Object { "Fn::Equals": Array [ Object { "Ref": "ALBSSLCertificateARN", }, "", ], }, ], }, "AssertDescription": "ACM Certificate value cannot be empty if SSL is required", }, Object { "Assert": Object { "Fn::Not": Array [ Object { "Fn::Equals": Array [ Object { "Ref": "HostedZoneName", }, "", ], }, ], }, "AssertDescription": "Route53 Hosted Zone Name is mandatory when SSL is required", }, ], "RuleCondition": Object { "Fn::Equals": Array [ Object { "Ref": "UseSSL", }, "Yes", ], }, }, }, "Transform": "AWS::LanguageExtensions", } `; exports[`Evaluation Valid templates templates/cfn-conditions.yaml 1`] = ` Object { "Conditions": Object { "IsProd": Object { "Fn::Equals": Array [ Object { "Ref": "Stage", }, "Prod", ], }, }, "Parameters": Object { "BucketName": Object { "Type": "String", }, "Stage": Object { "Default": "Gamma", "Type": "String", }, }, "Resources": Object { "MyBucketF68F3FF0": Object { "DeletionPolicy": "Retain", "Properties": Object { "BucketName": Object { "Fn::Join": Array [ "-", Array [ Object { "Ref": "AWS::Region", }, Object { "Ref": "BucketName", }, Object { "Fn::If": Array [ "IsProd", Object { "Ref": "AWS::NoValue", }, Object { "Ref": "Stage", }, ], }, ], ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Retain", }, "MyLambdaCCE802FB": Object { "DependsOn": Array [ "MyLambdaServiceRoleDefaultPolicy5BBC6F68", "MyLambdaServiceRole4539ECB6", ], "Properties": Object { "Code": Object { "S3Bucket": Object { "Ref": "MyBucketF68F3FF0", }, "S3Key": "handler.zip", }, "Handler": "index.handler", "MemorySize": 10240, "Role": Object { "Fn::GetAtt": Array [ "MyLambdaServiceRole4539ECB6", "Arn", ], }, "Runtime": "nodejs16.x", }, "Type": "AWS::Lambda::Function", }, "MyLambdaServiceRole4539ECB6": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "MyLambdaServiceRoleDefaultPolicy5BBC6F68": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": Array [ "s3:GetObject*", "s3:PutObject*", ], "Effect": "Allow", "Resource": Array [ Object { "Ref": "MyBucketF68F3FF0", }, Object { "Fn::Join": Array [ "", Array [ Object { "Fn::GetAtt": Array [ "MyBucketF68F3FF0", "Arn", ], }, "/*", ], ], }, ], }, ], "Version": "2012-10-17", }, "PolicyName": "MyLambdaServiceRoleDefaultPolicy5BBC6F68", "Roles": Array [ Object { "Ref": "MyLambdaServiceRole4539ECB6", }, ], }, "Type": "AWS::IAM::Policy", }, }, } `; exports[`Evaluation Valid templates templates/cfn-mappings.yaml 1`] = ` Object { "Mappings": Object { "RegionMap": Object { "eu-west-1": Object { "HVM64": "ami-047bb4163c506cd98", "HVMG2": "ami-0a7c483d527806435", }, "us-west-1": Object { "HVM64": "ami-0bdb828fd58c52235", "HVMG2": "ami-066ee5fd4a9ef77f1", }, }, }, "Resources": Object { "myEC2Instance": Object { "DeletionPolicy": "Delete", "Properties": Object { "ImageId": Object { "Fn::FindInMap": Array [ "RegionMap", Object { "Ref": "AWS::Region", }, "HVM64", ], }, "InstanceType": "m1.small", }, "Type": "AWS::EC2::Instance", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates templates/cfn-metadata.json 1`] = ` Object { "Metadata": Object { "Databases": Object { "Description": "Information about the databases", }, "Instances": Object { "Description": "Information about the instances", }, }, "Resources": Object { "MyQueueE6CA6235": Object { "DeletionPolicy": "Delete", "Properties": Object { "KmsMasterKeyId": Object { "Fn::GetAtt": Array [ "MyQueueKey6C31ABF3", "Arn", ], }, }, "Type": "AWS::SQS::Queue", "UpdateReplacePolicy": "Delete", }, "MyQueueKey6C31ABF3": Object { "DeletionPolicy": "Retain", "Properties": Object { "Description": "Created by Test/MyQueue", "KeyPolicy": Object { "Statement": Array [ Object { "Action": "kms:*", "Effect": "Allow", "Principal": Object { "AWS": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::", Object { "Ref": "AWS::AccountId", }, ":root", ], ], }, }, "Resource": "*", }, ], "Version": "2012-10-17", }, }, "Type": "AWS::KMS::Key", "UpdateReplacePolicy": "Retain", }, }, } `; exports[`Evaluation Valid templates templates/cfn-outputs-complex.json 1`] = ` Object { "Outputs": Object { "FunctionArn": Object { "Export": Object { "Name": Object { "Fn::Join": Array [ "-", Array [ Object { "Ref": "AWS::StackName", }, "FunctionName", ], ], }, }, "Value": Object { "Ref": "LambdaD247545B", }, }, }, "Resources": Object { "LambdaAllowInvokeTestTopic346FF53781B07C89": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "LambdaD247545B", "Arn", ], }, "Principal": "sns.amazonaws.com", "SourceArn": Object { "Ref": "TopicBFC7AF6E", }, }, "Type": "AWS::Lambda::Permission", }, "LambdaD247545B": Object { "DependsOn": Array [ "LambdaServiceRoleA8ED4D3B", ], "Properties": Object { "Code": Object { "S3Bucket": Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "41b1de375e679030ee7361874b689e99ab0657e9d274a8e6193d1513940a0c2f.zip", }, "Handler": "index.handler", "Role": Object { "Fn::GetAtt": Array [ "LambdaServiceRoleA8ED4D3B", "Arn", ], }, "Runtime": "nodejs", }, "Type": "AWS::Lambda::Function", }, "LambdaServiceRoleA8ED4D3B": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "LambdaTopicCCB0C2A3": Object { "Properties": Object { "Endpoint": Object { "Fn::GetAtt": Array [ "LambdaD247545B", "Arn", ], }, "Protocol": "lambda", "TopicArn": Object { "Ref": "TopicBFC7AF6E", }, }, "Type": "AWS::SNS::Subscription", }, "TopicBFC7AF6E": Object { "Type": "AWS::SNS::Topic", }, }, } `; exports[`Evaluation Valid templates templates/cfn-outputs-simple.json 1`] = ` Object { "AWSTemplateFormatVersion": "2010-09-09", "Description": "A template creates a lambda function with an api gateway", "Outputs": Object { "MyApiEndpoint869ABE96": Object { "Value": Object { "Fn::Join": Array [ "", Array [ "https://", Object { "Ref": "MyApi49610EDF", }, ".execute-api.", Object { "Ref": "AWS::Region", }, ".", Object { "Ref": "AWS::URLSuffix", }, "/", Object { "Ref": "MyApiDeploymentStageprodE1054AF0", }, "/", ], ], }, }, "SimpleValue": Object { "Description": "Sample primitive output value", "Export": Object { "Name": "SimpleValueExportName", }, "Value": "SimpleValue", }, }, "Resources": Object { "GetRootA9424890": Object { "Properties": Object { "AuthorizationType": "NONE", "HttpMethod": "GET", "Integration": Object { "IntegrationHttpMethod": "POST", "Type": "AWS_PROXY", "Uri": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":apigateway:", Object { "Ref": "AWS::Region", }, ":lambda:path/2015-03-31/functions/", Object { "Fn::GetAtt": Array [ "HelloLambda3D9C82D6", "Arn", ], }, "/invocations", ], ], }, }, "ResourceId": Object { "Fn::GetAtt": Array [ "MyApi49610EDF", "RootResourceId", ], }, "RestApiId": Object { "Ref": "MyApi49610EDF", }, }, "Type": "AWS::ApiGateway::Method", }, "GetRootApiPermissionTestMyApi8B2BE17AGET60A859EA": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloLambda3D9C82D6", "Arn", ], }, "Principal": "apigateway.amazonaws.com", "SourceArn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":execute-api:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "MyApi49610EDF", }, "/", Object { "Ref": "MyApiDeploymentStageprodE1054AF0", }, "/GET/", ], ], }, }, "Type": "AWS::Lambda::Permission", }, "GetRootApiPermissionTestTestMyApi8B2BE17AGETD0B1F4C3": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloLambda3D9C82D6", "Arn", ], }, "Principal": "apigateway.amazonaws.com", "SourceArn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":execute-api:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "MyApi49610EDF", }, "/test-invoke-stage/GET/", ], ], }, }, "Type": "AWS::Lambda::Permission", }, "HelloLambda3D9C82D6": Object { "DependsOn": Array [ "HelloLambdaServiceRoleE071F162", ], "Properties": Object { "Code": Object { "S3Bucket": Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "41b1de375e679030ee7361874b689e99ab0657e9d274a8e6193d1513940a0c2f.zip", }, "Handler": "index.handler", "Role": Object { "Fn::GetAtt": Array [ "HelloLambdaServiceRoleE071F162", "Arn", ], }, "Runtime": "python3.6", "Tags": Array [ Object { "Key": "category", "Value": "ecommerce", }, ], }, "Type": "AWS::Lambda::Function", }, "HelloLambdaServiceRoleE071F162": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], "Tags": Array [ Object { "Key": "category", "Value": "ecommerce", }, ], }, "Type": "AWS::IAM::Role", }, "MyApi49610EDF": Object { "Properties": Object { "Name": "MyApi", }, "Type": "AWS::ApiGateway::RestApi", }, "MyApiANYApiPermissionTestMyApi8B2BE17AANY689FE066": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloLambda3D9C82D6", "Arn", ], }, "Principal": "apigateway.amazonaws.com", "SourceArn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":execute-api:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "MyApi49610EDF", }, "/", Object { "Ref": "MyApiDeploymentStageprodE1054AF0", }, "/*/", ], ], }, }, "Type": "AWS::Lambda::Permission", }, "MyApiANYApiPermissionTestTestMyApi8B2BE17AANYE4477AC0": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloLambda3D9C82D6", "Arn", ], }, "Principal": "apigateway.amazonaws.com", "SourceArn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":execute-api:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "MyApi49610EDF", }, "/test-invoke-stage/*/", ], ], }, }, "Type": "AWS::Lambda::Permission", }, "MyApiANYEC3618D9": Object { "Properties": Object { "AuthorizationType": "NONE", "HttpMethod": "ANY", "Integration": Object { "IntegrationHttpMethod": "POST", "Type": "AWS_PROXY", "Uri": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":apigateway:", Object { "Ref": "AWS::Region", }, ":lambda:path/2015-03-31/functions/", Object { "Fn::GetAtt": Array [ "HelloLambda3D9C82D6", "Arn", ], }, "/invocations", ], ], }, }, "ResourceId": Object { "Fn::GetAtt": Array [ "MyApi49610EDF", "RootResourceId", ], }, "RestApiId": Object { "Ref": "MyApi49610EDF", }, }, "Type": "AWS::ApiGateway::Method", }, "MyApiAccount13882D84": Object { "DeletionPolicy": "Retain", "DependsOn": Array [ "MyApi49610EDF", ], "Properties": Object { "CloudWatchRoleArn": Object { "Fn::GetAtt": Array [ "MyApiCloudWatchRole2BEC1A9C", "Arn", ], }, }, "Type": "AWS::ApiGateway::Account", "UpdateReplacePolicy": "Retain", }, "MyApiCloudWatchRole2BEC1A9C": Object { "DeletionPolicy": "Retain", "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "apigateway.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs", ], ], }, ], }, "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, "MyApiDeploymentECB0D05E0597cc4592870e54c401cccc6090bd86": Object { "DependsOn": Array [ "GetRootA9424890", "MyApiproxyANYFCF46C66", "MyApiproxyE14DBEA4", "MyApiANYEC3618D9", ], "Properties": Object { "Description": "Automatically created by the RestApi construct", "RestApiId": Object { "Ref": "MyApi49610EDF", }, }, "Type": "AWS::ApiGateway::Deployment", }, "MyApiDeploymentStageprodE1054AF0": Object { "DependsOn": Array [ "MyApiAccount13882D84", ], "Properties": Object { "DeploymentId": Object { "Ref": "MyApiDeploymentECB0D05E0597cc4592870e54c401cccc6090bd86", }, "RestApiId": Object { "Ref": "MyApi49610EDF", }, "StageName": "prod", }, "Type": "AWS::ApiGateway::Stage", }, "MyApiproxyANYApiPermissionTestMyApi8B2BE17AANYproxyD8FBCB14": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloLambda3D9C82D6", "Arn", ], }, "Principal": "apigateway.amazonaws.com", "SourceArn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":execute-api:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "MyApi49610EDF", }, "/", Object { "Ref": "MyApiDeploymentStageprodE1054AF0", }, "/*/*", ], ], }, }, "Type": "AWS::Lambda::Permission", }, "MyApiproxyANYApiPermissionTestTestMyApi8B2BE17AANYproxy4A6D235F": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloLambda3D9C82D6", "Arn", ], }, "Principal": "apigateway.amazonaws.com", "SourceArn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":execute-api:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "MyApi49610EDF", }, "/test-invoke-stage/*/*", ], ], }, }, "Type": "AWS::Lambda::Permission", }, "MyApiproxyANYFCF46C66": Object { "Properties": Object { "AuthorizationType": "NONE", "HttpMethod": "ANY", "Integration": Object { "IntegrationHttpMethod": "POST", "Type": "AWS_PROXY", "Uri": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":apigateway:", Object { "Ref": "AWS::Region", }, ":lambda:path/2015-03-31/functions/", Object { "Fn::GetAtt": Array [ "HelloLambda3D9C82D6", "Arn", ], }, "/invocations", ], ], }, }, "ResourceId": Object { "Ref": "MyApiproxyE14DBEA4", }, "RestApiId": Object { "Ref": "MyApi49610EDF", }, }, "Type": "AWS::ApiGateway::Method", }, "MyApiproxyE14DBEA4": Object { "Properties": Object { "ParentId": Object { "Fn::GetAtt": Array [ "MyApi49610EDF", "RootResourceId", ], }, "PathPart": "{proxy+}", "RestApiId": Object { "Ref": "MyApi49610EDF", }, }, "Type": "AWS::ApiGateway::Resource", }, }, } `; exports[`Evaluation Valid templates templates/cfn-parameters.json 1`] = ` Object { "Parameters": Object { "BucketName": Object { "AllowedPattern": "^[a-zA-Z0-9]*$", "ConstraintDescription": "a string consisting only of alphanumeric characters", "Default": "MyS3Bucket", "Description": "The name of your bucket", "MaxLength": 10, "MinLength": 1, "NoEcho": true, "Type": "String", }, "CorsMaxAge": Object { "AllowedValues": Array [ 1, 2, 3, 10, 100, 300, "nonsense-string-value", ], "Default": "3", "Description": "the time in seconds that a browser will cache the preflight response", "MaxValue": 300, "MinValue": 0, "NoEcho": true, "Type": "Number", }, }, "Resources": Object { "Bucket83908E77": Object { "DeletionPolicy": "Retain", "Properties": Object { "BucketName": Object { "Ref": "BucketName", }, "CorsConfiguration": Object { "CorsRules": Array [ Object { "AllowedMethods": Array [ "GET", "POST", ], "AllowedOrigins": Array [ "origin1", "origin2", ], "MaxAge": Object { "Ref": "CorsMaxAge", }, }, ], }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Retain", }, }, } `; exports[`Evaluation Valid templates templates/cfn-policies.yaml 1`] = ` Object { "Resources": Object { "AutoScalingGroup": Object { "CreationPolicy": Object { "AutoScalingCreationPolicy": Object { "MinSuccessfulInstancesPercent": 50, }, "ResourceSignal": Object { "Count": "3", "Timeout": "PT15M", }, }, "DeletionPolicy": "Delete", "Properties": Object { "AvailabilityZones": Object { "Fn::GetAZs": "", }, "DesiredCapacity": "3", "LaunchConfigurationName": Object { "Ref": "LaunchConfig", }, "MaxSize": "4", "MinSize": "1", }, "Type": "AWS::AutoScaling::AutoScalingGroup", "UpdatePolicy": Object { "AutoScalingReplacingUpdate": Object { "WillReplace": false, }, "AutoScalingRollingUpdate": Object { "MaxBatchSize": 3, "MinInstancesInService": 5, "MinSuccessfulInstancesPercent": 42, "PauseTime": "PT10M", "SuspendProcesses": Array [ "Launch", "Terminate", ], "WaitOnResourceSignals": true, }, "AutoScalingScheduledAction": Object { "IgnoreUnmodifiedGroupSizeProperties": true, }, "CodeDeployLambdaAliasUpdate": Object { "AfterAllowTrafficHook": "SomeFunction", "ApplicationName": "SomeApp", "BeforeAllowTrafficHook": "AnotherFunction", "DeploymentGroupName": "SomeGroup", }, "EnableVersionUpgrade": false, "UseOnlineResharding": true, }, "UpdateReplacePolicy": "Retain", }, "LaunchConfig": Object { "DeletionPolicy": "Delete", "Metadata": Object { "Object1": "Location1", "Object2": "Location2", }, "Properties": Object { "ImageId": "ami-16d18a7e", "InstanceType": "t2.micro", "UserData": Object { "Fn::Base64": Object { "Fn::Sub": "#!/bin/bash -xe yum update -y aws-cfn-bootstrap /opt/aws/bin/cfn-signal -e $? --stack \${AWS::StackName} --resource AutoScalingGroup --region \${AWS::Region} ", }, }, }, "Type": "AWS::AutoScaling::LaunchConfiguration", "UpdateReplacePolicy": "Delete", }, }, } `; exports[`Evaluation Valid templates templates/cfn-transform.json 1`] = ` Object { "Resources": Object { "MyQueueE6CA6235": Object { "DeletionPolicy": "Delete", "Properties": Object { "KmsMasterKeyId": Object { "Fn::GetAtt": Array [ "MyQueueKey6C31ABF3", "Arn", ], }, }, "Type": "AWS::SQS::Queue", "UpdateReplacePolicy": "Delete", }, "MyQueueKey6C31ABF3": Object { "DeletionPolicy": "Retain", "Properties": Object { "Description": "Created by Test/MyQueue", "KeyPolicy": Object { "Statement": Array [ Object { "Action": "kms:*", "Effect": "Allow", "Principal": Object { "AWS": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::", Object { "Ref": "AWS::AccountId", }, ":root", ], ], }, }, "Resource": "*", }, ], "Version": "2012-10-17", }, }, "Type": "AWS::KMS::Key", "UpdateReplacePolicy": "Retain", }, }, "Transform": "AWS::LanguageExtensions", } `; exports[`Evaluation Valid templates templates/overrides-delete-path.json 1`] = ` Object { "Metadata": Object { "Databases": Object { "Description": "Information about the databases", }, "Instances": Object { "Description": "Information about the instances", }, }, "Resources": Object { "MyQueueE6CA6235": Object { "DeletionPolicy": "Delete", "Properties": Object { "KmsMasterKeyId": Object { "Fn::GetAtt": Array [ "MyQueueKey6C31ABF3", "Arn", ], }, }, "Type": "AWS::SQS::Queue", "UpdateReplacePolicy": "Delete", }, "MyQueueKey6C31ABF3": Object { "DeletionPolicy": "Retain", "Properties": Object { "KeyPolicy": Object { "Statement": Array [ Object { "Action": "kms:*", "Effect": "Allow", "Principal": Object { "AWS": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::", Object { "Ref": "AWS::AccountId", }, ":root", ], ], }, }, "Resource": "*", }, ], "Version": "2012-10-17", }, }, "Type": "AWS::KMS::Key", "UpdateReplacePolicy": "Retain", }, }, "Transform": "AWS::LanguageExtensions", } `; exports[`Evaluation Valid templates templates/overrides-remove-resource.json 1`] = ` Object { "Resources": Object { "LambdaD247545B": Object { "DependsOn": Array [ "LambdaServiceRoleA8ED4D3B", ], "Properties": Object { "Code": Object { "S3Bucket": Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "41b1de375e679030ee7361874b689e99ab0657e9d274a8e6193d1513940a0c2f.zip", }, "Description": "This function has its service role removed, for demonstration purposes. You probably wouldn't do this to a real function", "Handler": "index.handler", "Role": Object { "Fn::GetAtt": Array [ "LambdaServiceRoleA8ED4D3B", "Arn", ], }, "Runtime": "nodejs", }, "Type": "AWS::Lambda::Function", }, }, } `; exports[`Evaluation Valid templates templates/overrides-update-path.json 1`] = ` Object { "Description": "A template creates a lambda function which can be invoked by an sns topic", "Outputs": Object { "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FEndpointA8F0470B": Object { "Value": Object { "Fn::Join": Array [ "", Array [ "https://", Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", }, ".execute-api.", Object { "Ref": "AWS::Region", }, ".", Object { "Ref": "AWS::URLSuffix", }, "/", Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FDeploymentStageprodA76DE31E", }, "/", ], ], }, }, }, "Resources": Object { "HelloWorldFunctionAllowInvokeTestMyTopic06942AEA43E66FD3": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloWorldFunctionB2AB6E79", "Arn", ], }, "Principal": "sns.amazonaws.com", "SourceArn": Object { "Ref": "MyTopic86869434", }, }, "Type": "AWS::Lambda::Permission", }, "HelloWorldFunctionB2AB6E79": Object { "DependsOn": Array [ "HelloWorldFunctionServiceRoleDefaultPolicy6CCD7798", "HelloWorldFunctionServiceRole8E0BD458", ], "Properties": Object { "Code": Object { "S3Bucket": Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "41b1de375e679030ee7361874b689e99ab0657e9d274a8e6193d1513940a0c2f.zip", }, "Environment": Object { "Variables": Object { "Param": "f", }, }, "Handler": "app.hello_handler", "Role": Object { "Fn::GetAtt": Array [ "HelloWorldFunctionServiceRole8E0BD458", "Arn", ], }, "Runtime": "python3.6", }, "Type": "AWS::Lambda::Function", }, "HelloWorldFunctionDynamoDBEventSourceTestTable7FB9A4AF14EA3849": Object { "Properties": Object { "BatchSize": 100, "EventSourceArn": Object { "Fn::GetAtt": Array [ "TableCD117FA1", "StreamArn", ], }, "FunctionName": Object { "Ref": "HelloWorldFunctionB2AB6E79", }, "StartingPosition": "TRIM_HORIZON", }, "Type": "AWS::Lambda::EventSourceMapping", }, "HelloWorldFunctionMyTopic90F6E0EF": Object { "Properties": Object { "Endpoint": Object { "Fn::GetAtt": Array [ "HelloWorldFunctionB2AB6E79", "Arn", ], }, "Protocol": "lambda", "TopicArn": Object { "Ref": "MyTopic86869434", }, }, "Type": "AWS::SNS::Subscription", }, "HelloWorldFunctionServiceRole8E0BD458": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "Description": "This value has been overridden", "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "HelloWorldFunctionServiceRoleDefaultPolicy6CCD7798": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": "dynamodb:ListStreams", "Effect": "Allow", "Resource": "*", }, Object { "Action": Array [ "dynamodb:DescribeStream", "dynamodb:GetRecords", "dynamodb:GetShardIterator", ], "Effect": "Allow", "Resource": Object { "Fn::GetAtt": Array [ "TableCD117FA1", "StreamArn", ], }, }, ], "Version": "2012-10-17", }, "PolicyName": "HelloWorldFunctionServiceRoleDefaultPolicy6CCD7798", "Roles": Array [ Object { "Ref": "HelloWorldFunctionServiceRole8E0BD458", }, ], }, "Type": "AWS::IAM::Policy", }, "MyTopic86869434": Object { "Type": "AWS::SNS::Topic", }, "TableCD117FA1": Object { "DeletionPolicy": "Retain", "Properties": Object { "AttributeDefinitions": Array [ Object { "AttributeName": "ID", "AttributeType": "S", }, ], "KeySchema": Array [ Object { "AttributeName": "ID", "KeyType": "HASH", }, ], "ProvisionedThroughput": Object { "ReadCapacityUnits": 5, "WriteCapacityUnits": 5, }, "StreamSpecification": Object { "StreamViewType": "NEW_AND_OLD_IMAGES", }, }, "Type": "AWS::DynamoDB::Table", "UpdateReplacePolicy": "Retain", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA": Object { "Properties": Object { "Name": "TestHelloWorldFunctionE7E220B2:ApiEventSourceA7A86A4F", }, "Type": "AWS::ApiGateway::RestApi", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FAccount3FF2838C": Object { "DeletionPolicy": "Retain", "DependsOn": Array [ "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", ], "Properties": Object { "CloudWatchRoleArn": Object { "Fn::GetAtt": Array [ "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FCloudWatchRole6F1F54C4", "Arn", ], }, }, "Type": "AWS::ApiGateway::Account", "UpdateReplacePolicy": "Retain", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FCloudWatchRole6F1F54C4": Object { "DeletionPolicy": "Retain", "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "apigateway.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs", ], ], }, ], }, "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FDeployment1521BDCD1184383c2312dd2bd094c1c0b9e7069a": Object { "DependsOn": Array [ "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FhelloGETDEC3A558", "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FhelloPOST26F53363", "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4Fhello434790F5", ], "Properties": Object { "Description": "Automatically created by the RestApi construct", "RestApiId": Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", }, }, "Type": "AWS::ApiGateway::Deployment", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FDeploymentStageprodA76DE31E": Object { "DependsOn": Array [ "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FAccount3FF2838C", ], "Properties": Object { "DeploymentId": Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FDeployment1521BDCD1184383c2312dd2bd094c1c0b9e7069a", }, "RestApiId": Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", }, "StageName": "prod", }, "Type": "AWS::ApiGateway::Stage", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4Fhello434790F5": Object { "Properties": Object { "ParentId": Object { "Fn::GetAtt": Array [ "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", "RootResourceId", ], }, "PathPart": "hello", "RestApiId": Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", }, }, "Type": "AWS::ApiGateway::Resource", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FhelloGETApiPermissionTestTestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F2B53EF41GEThello55F7F880": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloWorldFunctionB2AB6E79", "Arn", ], }, "Principal": "apigateway.amazonaws.com", "SourceArn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":execute-api:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", }, "/", Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FDeploymentStageprodA76DE31E", }, "/GET/hello", ], ], }, }, "Type": "AWS::Lambda::Permission", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FhelloGETApiPermissionTestTestTestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F2B53EF41GEThelloDA94F7CA": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloWorldFunctionB2AB6E79", "Arn", ], }, "Principal": "apigateway.amazonaws.com", "SourceArn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":execute-api:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", }, "/test-invoke-stage/GET/hello", ], ], }, }, "Type": "AWS::Lambda::Permission", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FhelloGETDEC3A558": Object { "Properties": Object { "AuthorizationType": "NONE", "HttpMethod": "GET", "Integration": Object { "IntegrationHttpMethod": "POST", "Type": "AWS_PROXY", "Uri": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":apigateway:", Object { "Ref": "AWS::Region", }, ":lambda:path/2015-03-31/functions/", Object { "Fn::GetAtt": Array [ "HelloWorldFunctionB2AB6E79", "Arn", ], }, "/invocations", ], ], }, }, "ResourceId": Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4Fhello434790F5", }, "RestApiId": Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", }, }, "Type": "AWS::ApiGateway::Method", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FhelloPOST26F53363": Object { "Properties": Object { "AuthorizationType": "NONE", "HttpMethod": "POST", "Integration": Object { "IntegrationHttpMethod": "POST", "Type": "AWS_PROXY", "Uri": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":apigateway:", Object { "Ref": "AWS::Region", }, ":lambda:path/2015-03-31/functions/", Object { "Fn::GetAtt": Array [ "HelloWorldFunctionB2AB6E79", "Arn", ], }, "/invocations", ], ], }, }, "ResourceId": Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4Fhello434790F5", }, "RestApiId": Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", }, }, "Type": "AWS::ApiGateway::Method", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FhelloPOSTApiPermissionTestTestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F2B53EF41POSThelloAFA34AF4": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloWorldFunctionB2AB6E79", "Arn", ], }, "Principal": "apigateway.amazonaws.com", "SourceArn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":execute-api:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", }, "/", Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FDeploymentStageprodA76DE31E", }, "/POST/hello", ], ], }, }, "Type": "AWS::Lambda::Permission", }, "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4FhelloPOSTApiPermissionTestTestTestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F2B53EF41POSThello70EA31F2": Object { "Properties": Object { "Action": "lambda:InvokeFunction", "FunctionName": Object { "Fn::GetAtt": Array [ "HelloWorldFunctionB2AB6E79", "Arn", ], }, "Principal": "apigateway.amazonaws.com", "SourceArn": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":execute-api:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":", Object { "Ref": "TestHelloWorldFunctionE7E220B2ApiEventSourceA7A86A4F040973BA", }, "/test-invoke-stage/POST/hello", ], ], }, }, "Type": "AWS::Lambda::Permission", }, }, } `; exports[`Evaluation Valid templates templates/syntax-lambda-policy-from-constructor.yaml 1`] = ` Object { "Resources": Object { "MyBucketF68F3FF0": Object { "DeletionPolicy": "Retain", "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Retain", }, "MyLambdaCCE802FB": Object { "DependsOn": Array [ "MyLambdaServiceRoleDefaultPolicy5BBC6F68", "MyLambdaServiceRole4539ECB6", ], "Properties": Object { "Code": Object { "S3Bucket": Object { "Ref": "MyBucketF68F3FF0", }, "S3Key": "handler.zip", }, "Handler": "index.handler", "MemorySize": 10240, "Role": Object { "Fn::GetAtt": Array [ "MyLambdaServiceRole4539ECB6", "Arn", ], }, "Runtime": "nodejs16.x", }, "Type": "AWS::Lambda::Function", }, "MyLambdaServiceRole4539ECB6": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "MyLambdaServiceRoleDefaultPolicy5BBC6F68": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": Array [ "s3:GetObject*", "s3:PutObject*", ], "Effect": "Allow", "Resource": "*", }, ], "Version": "2012-10-17", }, "PolicyName": "MyLambdaServiceRoleDefaultPolicy5BBC6F68", "Roles": Array [ Object { "Ref": "MyLambdaServiceRole4539ECB6", }, ], }, "Type": "AWS::IAM::Policy", }, }, } `; exports[`Evaluation Valid templates templates/syntax-method-calls.json 1`] = ` Object { "AWSTemplateFormatVersion": "2010-09-09", "Mappings": Object { "DefaultCrNodeVersionMap": Object { "af-south-1": Object { "value": "nodejs16.x", }, "ap-east-1": Object { "value": "nodejs16.x", }, "ap-northeast-1": Object { "value": "nodejs16.x", }, "ap-northeast-2": Object { "value": "nodejs16.x", }, "ap-northeast-3": Object { "value": "nodejs16.x", }, "ap-south-1": Object { "value": "nodejs16.x", }, "ap-south-2": Object { "value": "nodejs16.x", }, "ap-southeast-1": Object { "value": "nodejs16.x", }, "ap-southeast-2": Object { "value": "nodejs16.x", }, "ap-southeast-3": Object { "value": "nodejs16.x", }, "ca-central-1": Object { "value": "nodejs16.x", }, "cn-north-1": Object { "value": "nodejs16.x", }, "cn-northwest-1": Object { "value": "nodejs16.x", }, "eu-central-1": Object { "value": "nodejs16.x", }, "eu-central-2": Object { "value": "nodejs16.x", }, "eu-north-1": Object { "value": "nodejs16.x", }, "eu-south-1": Object { "value": "nodejs16.x", }, "eu-south-2": Object { "value": "nodejs16.x", }, "eu-west-1": Object { "value": "nodejs16.x", }, "eu-west-2": Object { "value": "nodejs16.x", }, "eu-west-3": Object { "value": "nodejs16.x", }, "me-central-1": Object { "value": "nodejs16.x", }, "me-south-1": Object { "value": "nodejs16.x", }, "sa-east-1": Object { "value": "nodejs16.x", }, "us-east-1": Object { "value": "nodejs16.x", }, "us-east-2": Object { "value": "nodejs16.x", }, "us-gov-east-1": Object { "value": "nodejs16.x", }, "us-gov-west-1": Object { "value": "nodejs16.x", }, "us-iso-east-1": Object { "value": "nodejs14.x", }, "us-iso-west-1": Object { "value": "nodejs14.x", }, "us-isob-east-1": Object { "value": "nodejs14.x", }, "us-west-1": Object { "value": "nodejs16.x", }, "us-west-2": Object { "value": "nodejs16.x", }, }, }, "Resources": Object { "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A": Object { "DependsOn": Array [ "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB", ], "Properties": Object { "Code": Object { "S3Bucket": Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "5fa1330271b8967d9254ba2d4a07144f8acefe8b77e6d6bba38261373a50d5f8.zip", }, "Handler": "index.handler", "Role": Object { "Fn::GetAtt": Array [ "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB", "Arn", ], }, "Runtime": Object { "Fn::FindInMap": Array [ "DefaultCrNodeVersionMap", Object { "Ref": "AWS::Region", }, "value", ], }, }, "Type": "AWS::Lambda::Function", }, "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": Array [ "logs:PutRetentionPolicy", "logs:DeleteRetentionPolicy", ], "Effect": "Allow", "Resource": "*", }, ], "Version": "2012-10-17", }, "PolicyName": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", "Roles": Array [ Object { "Ref": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB", }, ], }, "Type": "AWS::IAM::Policy", }, "MyFunction3BAA72D1": Object { "DependsOn": Array [ "MyFunctionServiceRoleDefaultPolicyB705ABD4", "MyFunctionServiceRole3C357FF2", ], "Properties": Object { "Code": Object { "S3Bucket": Object { "Ref": "SourceBucketDDD2130A", }, "S3Key": "foo-bar", }, "Handler": "index.handler", "Role": Object { "Fn::GetAtt": Array [ "MyFunctionServiceRole3C357FF2", "Arn", ], }, "Runtime": "nodejs14.x", }, "Type": "AWS::Lambda::Function", }, "MyFunctionAliaslive8B92D042": Object { "Properties": Object { "FunctionName": Object { "Ref": "MyFunction3BAA72D1", }, "FunctionVersion": Object { "Fn::GetAtt": Array [ "MyFunctionCurrentVersion197490AF4063a7e304a1f5a926b2da07afacb434", "Version", ], }, "Name": "live", }, "Type": "AWS::Lambda::Alias", }, "MyFunctionAliasliveEventInvokeConfig4F48E2E2": Object { "Properties": Object { "FunctionName": Object { "Ref": "MyFunction3BAA72D1", }, "MaximumRetryAttempts": 2, "Qualifier": Object { "Fn::Select": Array [ 7, Object { "Fn::Split": Array [ ":", Object { "Ref": "MyFunctionAliaslive8B92D042", }, ], }, ], }, }, "Type": "AWS::Lambda::EventInvokeConfig", }, "MyFunctionCurrentVersion197490AF4063a7e304a1f5a926b2da07afacb434": Object { "Properties": Object { "FunctionName": Object { "Ref": "MyFunction3BAA72D1", }, }, "Type": "AWS::Lambda::Version", }, "MyFunctionLogRetention6A8272A3": Object { "Properties": Object { "LogGroupName": Object { "Fn::Join": Array [ "", Array [ "/aws/lambda/", Object { "Ref": "MyFunction3BAA72D1", }, ], ], }, "ServiceToken": Object { "Fn::GetAtt": Array [ "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", "Arn", ], }, }, "Type": "Custom::LogRetention", }, "MyFunctionServiceRole3C357FF2": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "MyFunctionServiceRoleDefaultPolicyB705ABD4": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": Array [ "s3:GetObject*", "s3:GetBucket*", "s3:List*", ], "Effect": "Allow", "Resource": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":s3:::read-bucket", ], ], }, Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":s3:::read-bucket/*", ], ], }, ], }, Object { "Action": Array [ "s3:DeleteObject*", "s3:PutObject", "s3:PutObjectLegalHold", "s3:PutObjectRetention", "s3:PutObjectTagging", "s3:PutObjectVersionTagging", "s3:Abort*", ], "Effect": "Allow", "Resource": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":s3:::write-bucket", ], ], }, Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":s3:::write-bucket/*", ], ], }, ], }, ], "Version": "2012-10-17", }, "PolicyName": "MyFunctionServiceRoleDefaultPolicyB705ABD4", "Roles": Array [ Object { "Ref": "MyFunctionServiceRole3C357FF2", }, ], }, "Type": "AWS::IAM::Policy", }, "SourceBucketDDD2130A": Object { "DeletionPolicy": "Retain", "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Retain", }, "User00B015A1": Object { "Type": "AWS::IAM::User", }, "UserDefaultPolicy1F97781E": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": Array [ "logs:CreateLogStream", "logs:PutLogEvents", ], "Effect": "Allow", "Resource": Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":logs:", Object { "Ref": "AWS::Region", }, ":", Object { "Ref": "AWS::AccountId", }, ":log-group:", Object { "Fn::GetAtt": Array [ "MyFunctionLogRetention6A8272A3", "LogGroupName", ], }, ":*", ], ], }, }, ], "Version": "2012-10-17", }, "PolicyName": "UserDefaultPolicy1F97781E", "Users": Array [ Object { "Ref": "User00B015A1", }, ], }, "Type": "AWS::IAM::Policy", }, }, } `; exports[`Evaluation Valid templates templates/syntax-short-intrinsics.yaml 1`] = ` Object { "Mappings": Object { "DefaultCrNodeVersionMap": Object { "af-south-1": Object { "value": "nodejs16.x", }, "ap-east-1": Object { "value": "nodejs16.x", }, "ap-northeast-1": Object { "value": "nodejs16.x", }, "ap-northeast-2": Object { "value": "nodejs16.x", }, "ap-northeast-3": Object { "value": "nodejs16.x", }, "ap-south-1": Object { "value": "nodejs16.x", }, "ap-south-2": Object { "value": "nodejs16.x", }, "ap-southeast-1": Object { "value": "nodejs16.x", }, "ap-southeast-2": Object { "value": "nodejs16.x", }, "ap-southeast-3": Object { "value": "nodejs16.x", }, "ca-central-1": Object { "value": "nodejs16.x", }, "cn-north-1": Object { "value": "nodejs16.x", }, "cn-northwest-1": Object { "value": "nodejs16.x", }, "eu-central-1": Object { "value": "nodejs16.x", }, "eu-central-2": Object { "value": "nodejs16.x", }, "eu-north-1": Object { "value": "nodejs16.x", }, "eu-south-1": Object { "value": "nodejs16.x", }, "eu-south-2": Object { "value": "nodejs16.x", }, "eu-west-1": Object { "value": "nodejs16.x", }, "eu-west-2": Object { "value": "nodejs16.x", }, "eu-west-3": Object { "value": "nodejs16.x", }, "me-central-1": Object { "value": "nodejs16.x", }, "me-south-1": Object { "value": "nodejs16.x", }, "sa-east-1": Object { "value": "nodejs16.x", }, "us-east-1": Object { "value": "nodejs16.x", }, "us-east-2": Object { "value": "nodejs16.x", }, "us-gov-east-1": Object { "value": "nodejs16.x", }, "us-gov-west-1": Object { "value": "nodejs16.x", }, "us-iso-east-1": Object { "value": "nodejs14.x", }, "us-iso-west-1": Object { "value": "nodejs14.x", }, "us-isob-east-1": Object { "value": "nodejs14.x", }, "us-west-1": Object { "value": "nodejs16.x", }, "us-west-2": Object { "value": "nodejs16.x", }, }, }, "Parameters": Object { "DashboardName": Object { "AllowedPattern": "^[a-zA-Z0-9-_]*$", "Default": "SampleDashboard", "Type": "String", }, }, "Resources": Object { "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A": Object { "DependsOn": Array [ "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB", ], "Properties": Object { "Code": Object { "S3Bucket": Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "5fa1330271b8967d9254ba2d4a07144f8acefe8b77e6d6bba38261373a50d5f8.zip", }, "Handler": "index.handler", "Role": Object { "Fn::GetAtt": Array [ "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB", "Arn", ], }, "Runtime": Object { "Fn::FindInMap": Array [ "DefaultCrNodeVersionMap", Object { "Ref": "AWS::Region", }, "value", ], }, }, "Type": "AWS::Lambda::Function", }, "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ Object { "Action": Array [ "logs:PutRetentionPolicy", "logs:DeleteRetentionPolicy", ], "Effect": "Allow", "Resource": "*", }, ], "Version": "2012-10-17", }, "PolicyName": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", "Roles": Array [ Object { "Ref": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB", }, ], }, "Type": "AWS::IAM::Policy", }, "SampleLambdaB2FF4FA1": Object { "DependsOn": Array [ "SampleLambdaServiceRoleB1A8618F", ], "Properties": Object { "Code": Object { "S3Bucket": Object { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "41b1de375e679030ee7361874b689e99ab0657e9d274a8e6193d1513940a0c2f.zip", }, "Handler": "index.handler", "MemorySize": 512, "Role": Object { "Fn::GetAtt": Array [ "SampleLambdaServiceRoleB1A8618F", "Arn", ], }, "Runtime": "nodejs16.x", "Timeout": 10, }, "Type": "AWS::Lambda::Function", }, "SampleLambdaLogRetentionE3451573": Object { "Properties": Object { "LogGroupName": Object { "Fn::Join": Array [ "", Array [ "/aws/lambda/", Object { "Ref": "SampleLambdaB2FF4FA1", }, ], ], }, "ServiceToken": Object { "Fn::GetAtt": Array [ "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", "Arn", ], }, }, "Type": "Custom::LogRetention", }, "SampleLambdaServiceRoleB1A8618F": Object { "Properties": Object { "AssumeRolePolicyDocument": Object { "Statement": Array [ Object { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": Object { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": Array [ Object { "Fn::Join": Array [ "", Array [ "arn:", Object { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "ServiceDashboard3C555A71": Object { "Properties": Object { "DashboardBody": Object { "Fn::Join": Array [ "", Array [ "{\\"widgets\\":[{\\"type\\":\\"text\\",\\"width\\":6,\\"height\\":2,\\"x\\":0,\\"y\\":0,\\"properties\\":{\\"markdown\\":\\"# Operational Metrics: ", Object { "Ref": "SampleLambdaB2FF4FA1", }, "\\"}},{\\"type\\":\\"metric\\",\\"width\\":6,\\"height\\":6,\\"x\\":6,\\"y\\":0,\\"properties\\":{\\"view\\":\\"timeSeries\\",\\"title\\":\\"Invocations\\",\\"region\\":\\"", Object { "Ref": "AWS::Region", }, "\\",\\"metrics\\":[[\\"AWS/Lambda\\",\\"Invocations\\",\\"FunctionName\\",\\"", Object { "Ref": "SampleLambdaB2FF4FA1", }, "\\",{\\"stat\\":\\"Sum\\"}]],\\"yAxis\\":{}}},{\\"type\\":\\"metric\\",\\"width\\":6,\\"height\\":6,\\"x\\":12,\\"y\\":0,\\"properties\\":{\\"view\\":\\"timeSeries\\",\\"title\\":\\"Errors\\",\\"region\\":\\"", Object { "Ref": "AWS::Region", }, "\\",\\"metrics\\":[[\\"AWS/Lambda\\",\\"Errors\\",\\"FunctionName\\",\\"", Object { "Ref": "SampleLambdaB2FF4FA1", }, "\\",{\\"stat\\":\\"Sum\\"}]],\\"yAxis\\":{}}},{\\"type\\":\\"metric\\",\\"width\\":6,\\"height\\":6,\\"x\\":18,\\"y\\":0,\\"properties\\":{\\"view\\":\\"timeSeries\\",\\"title\\":\\"Duration\\",\\"region\\":\\"", Object { "Ref": "AWS::Region", }, "\\",\\"metrics\\":[[\\"AWS/Lambda\\",\\"Duration\\",\\"FunctionName\\",\\"", Object { "Ref": "SampleLambdaB2FF4FA1", }, "\\"]],\\"yAxis\\":{}}},{\\"type\\":\\"metric\\",\\"width\\":6,\\"height\\":6,\\"x\\":0,\\"y\\":6,\\"properties\\":{\\"view\\":\\"timeSeries\\",\\"title\\":\\"Throttles\\",\\"region\\":\\"", Object { "Ref": "AWS::Region", }, "\\",\\"metrics\\":[[\\"AWS/Lambda\\",\\"Throttles\\",\\"FunctionName\\",\\"", Object { "Ref": "SampleLambdaB2FF4FA1", }, "\\",{\\"stat\\":\\"Sum\\"}]],\\"yAxis\\":{}}},{\\"type\\":\\"log\\",\\"width\\":24,\\"height\\":6,\\"x\\":0,\\"y\\":12,\\"properties\\":{\\"view\\":\\"table\\",\\"region\\":\\"", Object { "Ref": "AWS::Region", }, "\\",\\"query\\":\\"SOURCE '", Object { "Fn::GetAtt": Array [ "SampleLambdaLogRetentionE3451573", "LogGroupName", ], }, "' | fields @timestamp, @message\\\\n| sort @timestamp desc\\\\n| limit 20\\"}}]}", ], ], }, "DashboardName": Object { "Ref": "DashboardName", }, }, "Type": "AWS::CloudWatch::Dashboard", }, }, } `;