Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): automatic cross stack, cross region references (under feature flag) #22008

Merged
merged 37 commits into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
7f47baa
feat(core): automatic cross stack, cross region references
corymhall Sep 12, 2022
4ce8290
fixing build
corymhall Sep 13, 2022
97416cc
adding some tests and integration tests
corymhall Sep 14, 2022
cfcdd08
fixing integration tests
corymhall Sep 14, 2022
7a31868
hopefully fixing integ tests
corymhall Sep 14, 2022
b54bd80
Merge branch 'main' into corymhall/cross-region-provider
corymhall Sep 14, 2022
80f4092
updating README
corymhall Sep 15, 2022
783cb02
switching to ssm writer
corymhall Sep 23, 2022
104a249
Merge remote-tracking branch 'upstream/main' into corymhall/cross-reg…
corymhall Sep 23, 2022
49944e6
updating integration tests
corymhall Sep 23, 2022
a4ac262
renaming
corymhall Sep 23, 2022
3f99d97
updating docs
corymhall Sep 23, 2022
13b831b
fixing build
corymhall Sep 23, 2022
38c4226
adding stack name to ssm path prefix
corymhall Sep 23, 2022
56b4fe6
refactoring provider to use OldResourceProperties
corymhall Sep 26, 2022
5160273
rerunning integ tests
corymhall Sep 27, 2022
1933290
fixing formatting
corymhall Sep 27, 2022
472c337
fixing tests
corymhall Sep 27, 2022
308cb1b
Adding export reader in consuming stack
corymhall Sep 30, 2022
b02046d
updating docs
corymhall Sep 30, 2022
b833df2
fixing integ tests
corymhall Sep 30, 2022
954e005
Merge branch 'main' into corymhall/cross-region-provider
corymhall Sep 30, 2022
a58b1e7
adding another integ tests for cloudfront cross region acm certificates
corymhall Sep 30, 2022
d702e0f
fixing formatting
corymhall Sep 30, 2022
f9cbab7
fixing version of aws-sdk
corymhall Oct 3, 2022
3a1c86b
fix test
corymhall Oct 3, 2022
38b6779
fixing formatting in integ test
corymhall Oct 3, 2022
2c1a37b
Merge branch 'main' into corymhall/cross-region-provider
Naumel Oct 12, 2022
500ea0c
Merge branch 'main' into corymhall/cross-region-provider
Naumel Oct 13, 2022
7ffd80b
updates based on review comments
corymhall Oct 13, 2022
5fe1d7b
updating integ-tests and readme
corymhall Oct 13, 2022
01f3366
updating based on review comments
corymhall Oct 20, 2022
9e1c2dc
fixing tests
corymhall Oct 20, 2022
6b9660d
updating docs to indicate that this feature is experimental
corymhall Oct 28, 2022
fdea663
removing `optIn` from property name
corymhall Oct 31, 2022
3c1f2ff
Merge branch 'main' into corymhall/cross-region-provider
mergify[bot] Oct 31, 2022
6197448
Merge branch 'main' into corymhall/cross-region-provider
mergify[bot] Oct 31, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-cloudformation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"@aws-cdk/aws-ssm": "0.0.0",
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/integ-tests": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/aws-lambda": "^8.10.104",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"21.0.0"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"version": "21.0.0",
"files": {
"1ee31a833482538af5b3690ccbb84c41ac4c66f7892bcb8802b0695553bc4ccf": {
"source": {
"path": "asset.1ee31a833482538af5b3690ccbb84c41ac4c66f7892bcb8802b0695553bc4ccf",
"packaging": "zip"
},
"destinations": {
"12345678-us-east-2": {
"bucketName": "cdk-hnb659fds-assets-12345678-us-east-2",
"objectKey": "1ee31a833482538af5b3690ccbb84c41ac4c66f7892bcb8802b0695553bc4ccf.zip",
"region": "us-east-2",
"assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-us-east-2"
}
}
},
"f18a7bd6678575898edf76b4c96e9f9dee4f6ef1269ff16aa9d3c93a9862fd51": {
"source": {
"path": "crossregionconsumerIntegNested815BEF8A.nested.template.json",
"packaging": "file"
},
"destinations": {
"12345678-us-east-2": {
"bucketName": "cdk-hnb659fds-assets-12345678-us-east-2",
"objectKey": "f18a7bd6678575898edf76b4c96e9f9dee4f6ef1269ff16aa9d3c93a9862fd51.json",
"region": "us-east-2",
"assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-us-east-2"
}
}
},
"e26c2dfd5f9b7ba5526b3f009caa48d05359ab46c53a1b9652d10a9a8b01161e": {
"source": {
"path": "cross-region-consumer.template.json",
"packaging": "file"
},
"destinations": {
"12345678-us-east-2": {
"bucketName": "cdk-hnb659fds-assets-12345678-us-east-2",
"objectKey": "e26c2dfd5f9b7ba5526b3f009caa48d05359ab46c53a1b9652d10a9a8b01161e.json",
"region": "us-east-2",
"assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-us-east-2"
}
}
}
},
"dockerImages": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
{
"Resources": {
"IntegNestedNestedStackIntegNestedNestedStackResource168C5881": {
"Type": "AWS::CloudFormation::Stack",
"Properties": {
"TemplateURL": {
"Fn::Join": [
"",
[
"https://s3.us-east-2.",
{
"Ref": "AWS::URLSuffix"
},
"/cdk-hnb659fds-assets-12345678-us-east-2/f18a7bd6678575898edf76b4c96e9f9dee4f6ef1269ff16aa9d3c93a9862fd51.json"
]
]
}
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"IntegParameter02A1817A4": {
"Type": "AWS::SSM::Parameter",
"Properties": {
"Type": "String",
"Value": {
"Fn::GetAtt": [
"ExportsReaderuseast1D746CBDB",
"cross-region-producer:ExportsOutputFnGetAttIntegQueue3A18718AQueueName46C58A8F"
]
},
"Name": "integ-parameter0"
}
},
"IntegParameter1EDBEF1C6": {
"Type": "AWS::SSM::Parameter",
"Properties": {
"Type": "String",
"Value": {
"Fn::GetAtt": [
"ExportsReaderuseast1D746CBDB",
"cross-region-producer:ExportsOutputFnGetAttIntegNestedNestedStackIntegNestedNestedStackResource168C5881OutputscrossregionproducerIntegNestedNestedIntegQueueD686DB69QueueName7C64F4AE"
]
},
"Name": "integ-parameter1"
}
},
"ExportsReaderuseast1D746CBDB": {
"Type": "Custom::CrossRegionExportReader",
"Properties": {
"ServiceToken": {
"Fn::GetAtt": [
"CustomCrossRegionExportReaderCustomResourceProviderHandler46647B68",
"Arn"
]
},
"Region": "us-east-1",
"RefreshToken": "232744ad70da548e96b56a2d625574f9"
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"CustomCrossRegionExportReaderCustomResourceProviderRole10531BBD": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
}
}
]
},
"ManagedPolicyArns": [
{
"Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
}
],
"Policies": [
{
"PolicyName": "Inline",
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Resource": "*",
"Action": [
"cloudformation:ListExports"
]
}
]
}
}
]
}
},
"CustomCrossRegionExportReaderCustomResourceProviderHandler46647B68": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Code": {
"S3Bucket": "cdk-hnb659fds-assets-12345678-us-east-2",
"S3Key": "1ee31a833482538af5b3690ccbb84c41ac4c66f7892bcb8802b0695553bc4ccf.zip"
},
"Timeout": 900,
"MemorySize": 128,
"Handler": "__entrypoint__.handler",
"Role": {
"Fn::GetAtt": [
"CustomCrossRegionExportReaderCustomResourceProviderRole10531BBD",
"Arn"
]
},
"Runtime": "nodejs14.x"
},
"DependsOn": [
"CustomCrossRegionExportReaderCustomResourceProviderRole10531BBD"
]
}
},
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"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."
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"version": "21.0.0",
"files": {
"db4b89d277ac97fb3b94206516c7e60648f2e3a4d53793e2e8d073a607b04fdc": {
"source": {
"path": "crossregionproducerIntegNested3342EBEB.nested.template.json",
"packaging": "file"
},
"destinations": {
"12345678-us-east-1": {
"bucketName": "cdk-hnb659fds-assets-12345678-us-east-1",
"objectKey": "db4b89d277ac97fb3b94206516c7e60648f2e3a4d53793e2e8d073a607b04fdc.json",
"region": "us-east-1",
"assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-us-east-1"
}
}
},
"1b51dc5002497b083a035e23c4860bcb5629e1bc736934175db5d6e44994d6a0": {
"source": {
"path": "cross-region-producer.template.json",
"packaging": "file"
},
"destinations": {
"12345678-us-east-1": {
"bucketName": "cdk-hnb659fds-assets-12345678-us-east-1",
"objectKey": "1b51dc5002497b083a035e23c4860bcb5629e1bc736934175db5d6e44994d6a0.json",
"region": "us-east-1",
"assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-us-east-1"
}
}
}
},
"dockerImages": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"Resources": {
"IntegNestedNestedStackIntegNestedNestedStackResource168C5881": {
"Type": "AWS::CloudFormation::Stack",
"Properties": {
"TemplateURL": {
"Fn::Join": [
"",
[
"https://s3.us-east-1.",
{
"Ref": "AWS::URLSuffix"
},
"/cdk-hnb659fds-assets-12345678-us-east-1/db4b89d277ac97fb3b94206516c7e60648f2e3a4d53793e2e8d073a607b04fdc.json"
]
]
}
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"IntegQueue3A18718A": {
"Type": "AWS::SQS::Queue",
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
}
},
"Outputs": {
"ExportsOutputFnGetAttIntegQueue3A18718AQueueName46C58A8F": {
"Value": {
"Fn::GetAtt": [
"IntegQueue3A18718A",
"QueueName"
]
},
"Export": {
"Name": "cross-region-producer:ExportsOutputFnGetAttIntegQueue3A18718AQueueName46C58A8F"
}
},
"ExportsOutputFnGetAttIntegNestedNestedStackIntegNestedNestedStackResource168C5881OutputscrossregionproducerIntegNestedNestedIntegQueueD686DB69QueueName7C64F4AE": {
"Value": {
"Fn::GetAtt": [
"IntegNestedNestedStackIntegNestedNestedStackResource168C5881",
"Outputs.crossregionproducerIntegNestedNestedIntegQueueD686DB69QueueName"
]
},
"Export": {
"Name": "cross-region-producer:ExportsOutputFnGetAttIntegNestedNestedStackIntegNestedNestedStackResource168C5881OutputscrossregionproducerIntegNestedNestedIntegQueueD686DB69QueueName7C64F4AE"
}
}
},
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"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."
}
]
}
}
}
Loading