Skip to content

Commit

Permalink
feat(route53): new Route53 CrossAccountRecordSet construct
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Pafford authored and lukepafford committed Sep 3, 2024
1 parent 6d43146 commit 90739a8
Show file tree
Hide file tree
Showing 38 changed files with 36,218 additions and 65 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
{
"Resources": {
"SimpleRecordSetcrossaccountrecordsethandlerrolePolicyAppStackSimpleRecordSetcrossaccountrecordsethandlerrole9BA32FFD0FF56BE4": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Resource": "arn:aws:iam::786703845953:role/CrossAccountRecordSetRole"
}
],
"Version": "2012-10-17"
},
"PolicyName": "PolicyAppStackSimpleRecordSetcrossaccountrecordsethandlerrole9BA32FFD",
"Roles": [
{
"Fn::Select": [
1,
{
"Fn::Split": [
"/",
{
"Fn::Select": [
5,
{
"Fn::Split": [
":",
{
"Fn::GetAtt": [
"CustomCrossAccountRecordSetCustomResourceProviderRoleCC110A9E",
"Arn"
]
}
]
}
]
}
]
}
]
}
]
}
},
"SimpleRecordSetCrossAccountRecordSetCustomResourceDCDB1F47": {
"Type": "Custom::CrossAccountRecordSet",
"Properties": {
"ServiceToken": {
"Fn::GetAtt": [
"CustomCrossAccountRecordSetCustomResourceProviderHandlerDCAC57CF",
"Arn"
]
},
"AssumeRoleArn": "arn:aws:iam::786703845953:role/CrossAccountRecordSetRole",
"HostedZoneId": "Z05125833LLKMWFPHMF9L",
"Name": "test.global-test.lpafford.people.amazon.dev.",
"Type": "A",
"ResourceRecords": [
{
"Value": "1.2.3.4"
}
],
"TTL": 1800,
"SetIdentifier": "",
"GeoLocation": {},
"DeleteExisting": false
},
"DependsOn": [
"SimpleRecordSetcrossaccountrecordsethandlerrolePolicyAppStackSimpleRecordSetcrossaccountrecordsethandlerrole9BA32FFD0FF56BE4"
],
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"CustomCrossAccountRecordSetCustomResourceProviderRoleCC110A9E": {
"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"
}
]
}
},
"CustomCrossAccountRecordSetCustomResourceProviderHandlerDCAC57CF": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Code": {
"S3Bucket": "cdk-hnb659fds-assets-453872816227-us-west-1",
"S3Key": "020afdb13bf8c2fea7bafb38123bf169f9bcf4ac71f0988d77f8c4c0aad09c21.zip"
},
"Timeout": 30,
"MemorySize": 256,
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"CustomCrossAccountRecordSetCustomResourceProviderRoleCC110A9E",
"Arn"
]
},
"Runtime": "nodejs20.x",
"Description": "Lambda function for CrossAccountRecordSet custom resource"
},
"DependsOn": [
"CustomCrossAccountRecordSetCustomResourceProviderRoleCC110A9E"
]
}
},
"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."
}
]
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"Resources": {
"CrossAccountRoleFACE29D1": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::453872816227:root",
"arn:aws:iam::786703845953:root"
]
}
}
],
"Version": "2012-10-17"
},
"RoleName": "CrossAccountRecordSetRole"
}
},
"AllowRecordSetReadWriteC5B9AFE5": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyDocument": {
"Statement": [
{
"Action": [
"route53:ChangeResourceRecordSets",
"route53:ListResourceRecordSets"
],
"Condition": {
"ForAllValues:StringLike": {
"route53:ChangeResourceRecordSetsNormalizedRecordNames": [
"test.global-test.lpafford.people.amazon.dev"
]
},
"ForAllValues:StringEquals": {
"route53:ChangeResourceRecordSetsRecordTypes": [
"A"
]
}
},
"Effect": "Allow",
"Resource": "arn:aws:route53:::hostedzone/Z05125833LLKMWFPHMF9L"
}
],
"Version": "2012-10-17"
},
"PolicyName": "Allow-RecordSet-Read-Write",
"Roles": [
{
"Ref": "CrossAccountRoleFACE29D1"
}
]
}
}
},
"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."
}
]
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 90739a8

Please sign in to comment.