// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`default configuration 1`] = ` { "Outputs": { "SnapshotCommand": { "Description": "Snapshot Test/fake--path--to--repository--StagingBucket", "Value": { "Fn::Join": [ "", [ "aws s3 sync s3://", { "Ref": "fakepathtorepositoryStagingBucketF571B2BA", }, " s3://", { "Ref": "FailoverfakepathtorepositoryStagingBucket6DEF61AC", }, ], ], }, }, }, "Parameters": { "BootstrapVersion": { "Default": "/cdk-bootstrap/hnb659fds/version", "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]", "Type": "AWS::SSM::Parameter::Value", }, }, "Resources": { "FailoverfakepathtorepositoryStagingBucket6DEF61AC": { "DeletionPolicy": "Retain", "Properties": { "LifecycleConfiguration": { "Rules": [ { "ExpirationInDays": 30, "Status": "Enabled", }, ], }, "PublicAccessBlockConfiguration": { "BlockPublicAcls": true, "BlockPublicPolicy": true, "IgnorePublicAcls": true, "RestrictPublicBuckets": true, }, "Tags": [ { "Key": "failover", "Value": "true", }, ], }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Retain", }, "FailoverfakepathtorepositoryStagingBucketPolicyAE020014": { "Properties": { "Bucket": { "Ref": "FailoverfakepathtorepositoryStagingBucket6DEF61AC", }, "PolicyDocument": { "Statement": [ { "Action": "s3:*", "Condition": { "Bool": { "aws:SecureTransport": "false", }, }, "Effect": "Deny", "Principal": { "AWS": "*", }, "Resource": [ { "Fn::GetAtt": [ "FailoverfakepathtorepositoryStagingBucket6DEF61AC", "Arn", ], }, { "Fn::Join": [ "", [ { "Fn::GetAtt": [ "FailoverfakepathtorepositoryStagingBucket6DEF61AC", "Arn", ], }, "/*", ], ], }, ], }, ], "Version": "2012-10-17", }, }, "Type": "AWS::S3::BucketPolicy", }, "MockIngestionRole7B5CD59F": { "Type": "AWS::IAM::User", }, "MockIngestionRoleDefaultPolicy9E551219": { "Properties": { "PolicyDocument": { "Statement": [ { "Action": [ "s3:GetObject*", "s3:GetBucket*", "s3:List*", ], "Effect": "Allow", "Resource": [ { "Fn::GetAtt": [ "fakepathtorepositoryStagingBucketF571B2BA", "Arn", ], }, { "Fn::Join": [ "", [ { "Fn::GetAtt": [ "fakepathtorepositoryStagingBucketF571B2BA", "Arn", ], }, "/*", ], ], }, ], }, ], "Version": "2012-10-17", }, "PolicyName": "MockIngestionRoleDefaultPolicy9E551219", "Users": [ { "Ref": "MockIngestionRole7B5CD59F", }, ], }, "Type": "AWS::IAM::Policy", }, "fakepathtorepositoryDLQAE116084": { "DeletionPolicy": "Delete", "Properties": { "KmsMasterKeyId": "alias/aws/sqs", "MessageRetentionPeriod": 1209600, "VisibilityTimeout": 900, }, "Type": "AWS::SQS::Queue", "UpdateReplacePolicy": "Delete", }, "fakepathtorepositoryEventBridgeAllowEventRuleTestfakepathtorepositoryForwarderDE3B2A6D81A22B29": { "DependsOn": [ "fakepathtorepositoryForwarderDLQNotEmpty0ABFCB5C", "fakepathtorepositoryForwarderFailures8D0BDD52", ], "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { "Fn::GetAtt": [ "fakepathtorepositoryForwarder90BF304A", "Arn", ], }, "Principal": "events.amazonaws.com", "SourceArn": { "Fn::GetAtt": [ "fakepathtorepositoryEventBridgeCAB0C06A", "Arn", ], }, }, "Type": "AWS::Lambda::Permission", }, "fakepathtorepositoryEventBridgeCAB0C06A": { "DependsOn": [ "fakepathtorepositoryForwarderDLQNotEmpty0ABFCB5C", "fakepathtorepositoryForwarderFailures8D0BDD52", ], "Properties": { "Description": "Test/CodeArtifact/123456789012:mock-domain-name/mock-repository-name/EventBridge", "EventPattern": { "detail": { "domainName": [ "mock-domain-name", ], "domainOwner": [ "123456789012", ], "packageFormat": [ "npm", ], "repositoryName": [ "mock-repository-name", ], }, "detail-type": [ "CodeArtifact Package Version State Change", ], "source": [ "aws.codeartifact", ], }, "State": "ENABLED", "Targets": [ { "Arn": { "Fn::GetAtt": [ "fakepathtorepositoryForwarder90BF304A", "Arn", ], }, "Id": "Target0", }, ], }, "Type": "AWS::Events::Rule", }, "fakepathtorepositoryForwarder90BF304A": { "DependsOn": [ "fakepathtorepositoryForwarderServiceRoleDefaultPolicy238521BA", "fakepathtorepositoryForwarderServiceRole3D1A3F1B", ], "Properties": { "Architectures": [ "arm64", ], "Code": { "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "84957f52bc9dc7c021c1b961d6a5e1a9fbd3657ec21f2fbf01197a5962b11814.zip", }, "DeadLetterConfig": { "TargetArn": { "Fn::GetAtt": [ "fakepathtorepositoryDLQAE116084", "Arn", ], }, }, "Description": "[Test/CodeArtifact/123456789012:mock-domain-name/mock-repository-name] Handle CodeArtifact EventBridge events", "Environment": { "Variables": { "AWS_EMF_ENVIRONMENT": "Local", "BUCKET_NAME": { "Ref": "fakepathtorepositoryStagingBucketF571B2BA", }, "QUEUE_URL": "https://fake-queue-url/phony", }, }, "Handler": "index.handler", "MemorySize": 1024, "Role": { "Fn::GetAtt": [ "fakepathtorepositoryForwarderServiceRole3D1A3F1B", "Arn", ], }, "Runtime": "nodejs16.x", "Timeout": 60, "TracingConfig": { "Mode": "Active", }, }, "Type": "AWS::Lambda::Function", }, "fakepathtorepositoryForwarderDLQNotEmpty0ABFCB5C": { "Properties": { "AlarmDescription": { "Fn::Join": [ "", [ "The CodeArtifact fowarder for 123456789012:mock-domain-name/mock-repository-name is failing/n/nLink to the lambda function: /lambda/home#/functions/", { "Ref": "fakepathtorepositoryForwarder90BF304A", }, "/nLink to the dead letter queue: /sqs/v2/home#/queues/https%3A%2F%2Fsqs.", { "Ref": "AWS::Region", }, ".amazonaws.com%2F", { "Ref": "AWS::AccountId", }, "%2F", { "Fn::GetAtt": [ "fakepathtorepositoryDLQAE116084", "QueueName", ], }, ], ], }, "AlarmName": "Test/CodeArtifact/123456789012:mock-domain-name/mock-repository-name/DLQNotEmpty", "ComparisonOperator": "GreaterThanOrEqualToThreshold", "EvaluationPeriods": 1, "Metrics": [ { "Expression": "mVisible + mHidden", "Id": "expr_1", }, { "Id": "mVisible", "MetricStat": { "Metric": { "Dimensions": [ { "Name": "QueueName", "Value": { "Fn::GetAtt": [ "fakepathtorepositoryDLQAE116084", "QueueName", ], }, }, ], "MetricName": "ApproximateNumberOfMessagesVisible", "Namespace": "AWS/SQS", }, "Period": 300, "Stat": "Maximum", }, "ReturnData": false, }, { "Id": "mHidden", "MetricStat": { "Metric": { "Dimensions": [ { "Name": "QueueName", "Value": { "Fn::GetAtt": [ "fakepathtorepositoryDLQAE116084", "QueueName", ], }, }, ], "MetricName": "ApproximateNumberOfMessagesNotVisible", "Namespace": "AWS/SQS", }, "Period": 300, "Stat": "Maximum", }, "ReturnData": false, }, ], "Threshold": 1, "TreatMissingData": "notBreaching", }, "Type": "AWS::CloudWatch::Alarm", }, "fakepathtorepositoryForwarderFailures8D0BDD52": { "Properties": { "AlarmDescription": { "Fn::Join": [ "", [ "The CodeArtifact fowarder for 123456789012:mock-domain-name/mock-repository-name is failing Link to the lambda function: /lambda/home#/functions/", { "Ref": "fakepathtorepositoryForwarder90BF304A", }, ], ], }, "AlarmName": "Test/CodeArtifact/123456789012:mock-domain-name/mock-repository-name/Forwarder", "ComparisonOperator": "GreaterThanOrEqualToThreshold", "Dimensions": [ { "Name": "FunctionName", "Value": { "Ref": "fakepathtorepositoryForwarder90BF304A", }, }, ], "EvaluationPeriods": 3, "MetricName": "Errors", "Namespace": "AWS/Lambda", "Period": 300, "Statistic": "Sum", "Threshold": 1, "TreatMissingData": "missing", }, "Type": "AWS::CloudWatch::Alarm", }, "fakepathtorepositoryForwarderServiceRole3D1A3F1B": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": [ { "Fn::Join": [ "", [ "arn:", { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "fakepathtorepositoryForwarderServiceRoleDefaultPolicy238521BA": { "Properties": { "PolicyDocument": { "Statement": [ { "Action": "sqs:SendMessage", "Effect": "Allow", "Resource": { "Fn::GetAtt": [ "fakepathtorepositoryDLQAE116084", "Arn", ], }, }, { "Action": [ "xray:PutTraceSegments", "xray:PutTelemetryRecords", ], "Effect": "Allow", "Resource": "*", }, { "Action": [ "s3:GetObject*", "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", "s3:PutObject", "s3:PutObjectLegalHold", "s3:PutObjectRetention", "s3:PutObjectTagging", "s3:PutObjectVersionTagging", "s3:Abort*", ], "Effect": "Allow", "Resource": [ { "Fn::GetAtt": [ "fakepathtorepositoryStagingBucketF571B2BA", "Arn", ], }, { "Fn::Join": [ "", [ { "Fn::GetAtt": [ "fakepathtorepositoryStagingBucketF571B2BA", "Arn", ], }, "/*", ], ], }, ], }, { "Action": "codeartifact:GetPackageVersionAsset", "Effect": "Allow", "Resource": { "Fn::Join": [ "", [ "arn:", { "Ref": "AWS::Partition", }, ":codeartifact:", { "Ref": "AWS::Region", }, ":", { "Ref": "AWS::AccountId", }, ":package/mock-domain-name/mock-repository-name/npm/*", ], ], }, }, ], "Version": "2012-10-17", }, "PolicyName": "fakepathtorepositoryForwarderServiceRoleDefaultPolicy238521BA", "Roles": [ { "Ref": "fakepathtorepositoryForwarderServiceRole3D1A3F1B", }, ], }, "Type": "AWS::IAM::Policy", }, "fakepathtorepositoryStagingBucketF571B2BA": { "DeletionPolicy": "Retain", "Properties": { "LifecycleConfiguration": { "Rules": [ { "ExpirationInDays": 30, "Status": "Enabled", }, ], }, "PublicAccessBlockConfiguration": { "BlockPublicAcls": true, "BlockPublicPolicy": true, "IgnorePublicAcls": true, "RestrictPublicBuckets": true, }, }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Retain", }, "fakepathtorepositoryStagingBucketPolicy737DE541": { "Properties": { "Bucket": { "Ref": "fakepathtorepositoryStagingBucketF571B2BA", }, "PolicyDocument": { "Statement": [ { "Action": "s3:*", "Condition": { "Bool": { "aws:SecureTransport": "false", }, }, "Effect": "Deny", "Principal": { "AWS": "*", }, "Resource": [ { "Fn::GetAtt": [ "fakepathtorepositoryStagingBucketF571B2BA", "Arn", ], }, { "Fn::Join": [ "", [ { "Fn::GetAtt": [ "fakepathtorepositoryStagingBucketF571B2BA", "Arn", ], }, "/*", ], ], }, ], }, ], "Version": "2012-10-17", }, }, "Type": "AWS::S3::BucketPolicy", }, }, "Rules": { "CheckBootstrapVersion": { "Assertions": [ { "Assert": { "Fn::Not": [ { "Fn::Contains": [ [ "1", "2", "3", "4", "5", ], { "Ref": "BootstrapVersion", }, ], }, ], }, "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI.", }, ], }, }, } `; exports[`user-provided staging bucket 1`] = ` { "Parameters": { "BootstrapVersion": { "Default": "/cdk-bootstrap/hnb659fds/version", "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]", "Type": "AWS::SSM::Parameter::Value", }, }, "Resources": { "fakepathtorepositoryDLQAE116084": { "DeletionPolicy": "Delete", "Properties": { "KmsMasterKeyId": "alias/aws/sqs", "MessageRetentionPeriod": 1209600, "VisibilityTimeout": 900, }, "Type": "AWS::SQS::Queue", "UpdateReplacePolicy": "Delete", }, "fakepathtorepositoryEventBridgeAllowEventRuleTestfakepathtorepositoryForwarderDE3B2A6D81A22B29": { "DependsOn": [ "fakepathtorepositoryForwarderDLQNotEmpty0ABFCB5C", "fakepathtorepositoryForwarderFailures8D0BDD52", ], "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { "Fn::GetAtt": [ "fakepathtorepositoryForwarder90BF304A", "Arn", ], }, "Principal": "events.amazonaws.com", "SourceArn": { "Fn::GetAtt": [ "fakepathtorepositoryEventBridgeCAB0C06A", "Arn", ], }, }, "Type": "AWS::Lambda::Permission", }, "fakepathtorepositoryEventBridgeCAB0C06A": { "DependsOn": [ "fakepathtorepositoryForwarderDLQNotEmpty0ABFCB5C", "fakepathtorepositoryForwarderFailures8D0BDD52", ], "Properties": { "Description": "Test/CodeArtifact/123456789012:mock-domain-name/mock-repository-name/EventBridge", "EventPattern": { "detail": { "domainName": [ "mock-domain-name", ], "domainOwner": [ "123456789012", ], "packageFormat": [ "npm", ], "repositoryName": [ "mock-repository-name", ], }, "detail-type": [ "CodeArtifact Package Version State Change", ], "source": [ "aws.codeartifact", ], }, "State": "ENABLED", "Targets": [ { "Arn": { "Fn::GetAtt": [ "fakepathtorepositoryForwarder90BF304A", "Arn", ], }, "Id": "Target0", }, ], }, "Type": "AWS::Events::Rule", }, "fakepathtorepositoryForwarder90BF304A": { "DependsOn": [ "fakepathtorepositoryForwarderServiceRoleDefaultPolicy238521BA", "fakepathtorepositoryForwarderServiceRole3D1A3F1B", ], "Properties": { "Architectures": [ "arm64", ], "Code": { "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, "S3Key": "84957f52bc9dc7c021c1b961d6a5e1a9fbd3657ec21f2fbf01197a5962b11814.zip", }, "DeadLetterConfig": { "TargetArn": { "Fn::GetAtt": [ "fakepathtorepositoryDLQAE116084", "Arn", ], }, }, "Description": "[Test/CodeArtifact/123456789012:mock-domain-name/mock-repository-name] Handle CodeArtifact EventBridge events", "Environment": { "Variables": { "AWS_EMF_ENVIRONMENT": "Local", "BUCKET_NAME": "mock-bucket", "QUEUE_URL": "https://fake-queue-url/phony", }, }, "Handler": "index.handler", "MemorySize": 1024, "Role": { "Fn::GetAtt": [ "fakepathtorepositoryForwarderServiceRole3D1A3F1B", "Arn", ], }, "Runtime": "nodejs16.x", "Timeout": 60, "TracingConfig": { "Mode": "Active", }, }, "Type": "AWS::Lambda::Function", }, "fakepathtorepositoryForwarderDLQNotEmpty0ABFCB5C": { "Properties": { "AlarmDescription": { "Fn::Join": [ "", [ "The CodeArtifact fowarder for 123456789012:mock-domain-name/mock-repository-name is failing/n/nLink to the lambda function: /lambda/home#/functions/", { "Ref": "fakepathtorepositoryForwarder90BF304A", }, "/nLink to the dead letter queue: /sqs/v2/home#/queues/https%3A%2F%2Fsqs.", { "Ref": "AWS::Region", }, ".amazonaws.com%2F", { "Ref": "AWS::AccountId", }, "%2F", { "Fn::GetAtt": [ "fakepathtorepositoryDLQAE116084", "QueueName", ], }, ], ], }, "AlarmName": "Test/CodeArtifact/123456789012:mock-domain-name/mock-repository-name/DLQNotEmpty", "ComparisonOperator": "GreaterThanOrEqualToThreshold", "EvaluationPeriods": 1, "Metrics": [ { "Expression": "mVisible + mHidden", "Id": "expr_1", }, { "Id": "mVisible", "MetricStat": { "Metric": { "Dimensions": [ { "Name": "QueueName", "Value": { "Fn::GetAtt": [ "fakepathtorepositoryDLQAE116084", "QueueName", ], }, }, ], "MetricName": "ApproximateNumberOfMessagesVisible", "Namespace": "AWS/SQS", }, "Period": 300, "Stat": "Maximum", }, "ReturnData": false, }, { "Id": "mHidden", "MetricStat": { "Metric": { "Dimensions": [ { "Name": "QueueName", "Value": { "Fn::GetAtt": [ "fakepathtorepositoryDLQAE116084", "QueueName", ], }, }, ], "MetricName": "ApproximateNumberOfMessagesNotVisible", "Namespace": "AWS/SQS", }, "Period": 300, "Stat": "Maximum", }, "ReturnData": false, }, ], "Threshold": 1, "TreatMissingData": "notBreaching", }, "Type": "AWS::CloudWatch::Alarm", }, "fakepathtorepositoryForwarderFailures8D0BDD52": { "Properties": { "AlarmDescription": { "Fn::Join": [ "", [ "The CodeArtifact fowarder for 123456789012:mock-domain-name/mock-repository-name is failing Link to the lambda function: /lambda/home#/functions/", { "Ref": "fakepathtorepositoryForwarder90BF304A", }, ], ], }, "AlarmName": "Test/CodeArtifact/123456789012:mock-domain-name/mock-repository-name/Forwarder", "ComparisonOperator": "GreaterThanOrEqualToThreshold", "Dimensions": [ { "Name": "FunctionName", "Value": { "Ref": "fakepathtorepositoryForwarder90BF304A", }, }, ], "EvaluationPeriods": 3, "MetricName": "Errors", "Namespace": "AWS/Lambda", "Period": 300, "Statistic": "Sum", "Threshold": 1, "TreatMissingData": "missing", }, "Type": "AWS::CloudWatch::Alarm", }, "fakepathtorepositoryForwarderServiceRole3D1A3F1B": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": [ { "Fn::Join": [ "", [ "arn:", { "Ref": "AWS::Partition", }, ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "fakepathtorepositoryForwarderServiceRoleDefaultPolicy238521BA": { "Properties": { "PolicyDocument": { "Statement": [ { "Action": "sqs:SendMessage", "Effect": "Allow", "Resource": { "Fn::GetAtt": [ "fakepathtorepositoryDLQAE116084", "Arn", ], }, }, { "Action": [ "xray:PutTraceSegments", "xray:PutTelemetryRecords", ], "Effect": "Allow", "Resource": "*", }, { "Action": "codeartifact:GetPackageVersionAsset", "Effect": "Allow", "Resource": { "Fn::Join": [ "", [ "arn:", { "Ref": "AWS::Partition", }, ":codeartifact:", { "Ref": "AWS::Region", }, ":", { "Ref": "AWS::AccountId", }, ":package/mock-domain-name/mock-repository-name/npm/*", ], ], }, }, ], "Version": "2012-10-17", }, "PolicyName": "fakepathtorepositoryForwarderServiceRoleDefaultPolicy238521BA", "Roles": [ { "Ref": "fakepathtorepositoryForwarderServiceRole3D1A3F1B", }, ], }, "Type": "AWS::IAM::Policy", }, }, "Rules": { "CheckBootstrapVersion": { "Assertions": [ { "Assert": { "Fn::Not": [ { "Fn::Contains": [ [ "1", "2", "3", "4", "5", ], { "Ref": "BootstrapVersion", }, ], }, ], }, "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI.", }, ], }, }, } `;