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

fix(all constructs): use aws.partition where value could refer to govcloud #941

Merged
merged 4 commits into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ export class ApiGatewayToIot extends Construct {
Action: [
"iot:UpdateThingShadow"
],
Resource: `arn:aws:iot:${cdk.Aws.REGION}:${cdk.Aws.ACCOUNT_ID}:thing/*`,
Resource: `arn:${cdk.Aws.PARTITION}:iot:${cdk.Aws.REGION}:${cdk.Aws.ACCOUNT_ID}:thing/*`,
Effect: "Allow"
},
{
Action: [
"iot:Publish"
],
Resource: `arn:aws:iot:${cdk.Aws.REGION}:${cdk.Aws.ACCOUNT_ID}:topic/*`,
Resource: `arn:${cdk.Aws.PARTITION}:iot:${cdk.Aws.REGION}:${cdk.Aws.ACCOUNT_ID}:topic/*`,
Effect: "Allow"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
"Fn::Join": [
"",
[
"arn:aws:iot:",
"arn:",
{
"Ref": "AWS::Partition"
},
":iot:",
{
"Ref": "AWS::Region"
},
Expand All @@ -48,7 +52,11 @@
"Fn::Join": [
"",
[
"arn:aws:iot:",
"arn:",
{
"Ref": "AWS::Partition"
},
":iot:",
{
"Ref": "AWS::Region"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ const props: ApiGatewayToIotProps = {
new ApiGatewayToIot(stack, 'test-apigateway-iot', props);

// Synth
app.synth();
app.synth();
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
"Fn::Join": [
"",
[
"arn:aws:iot:",
"arn:",
{
"Ref": "AWS::Partition"
},
":iot:",
{
"Ref": "AWS::Region"
},
Expand All @@ -48,7 +52,11 @@
"Fn::Join": [
"",
[
"arn:aws:iot:",
"arn:",
{
"Ref": "AWS::Partition"
},
":iot:",
{
"Ref": "AWS::Region"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ test('Test for default IAM Role', () => {
"Fn::Join": [
"",
[
"arn:aws:iot:",
"arn:",
{
Ref: "AWS::Partition"
},
":iot:",
{
Ref: "AWS::Region"
},
Expand All @@ -92,7 +96,11 @@ test('Test for default IAM Role', () => {
"Fn::Join": [
"",
[
"arn:aws:iot:",
"arn:",
{
Ref: "AWS::Partition"
},
":iot:",
{
Ref: "AWS::Region"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ test('test cloudfront disable cloudfront logging', () => {
test('test cloudfront with custom domain names', () => {
const stack = new cdk.Stack();

const certificate = acm.Certificate.fromCertificateArn(stack, 'Cert', 'arn:aws:acm:us-east-1:123456789012:certificate/11112222-3333-1234-1234-123456789012');
const certificate = acm.Certificate.fromCertificateArn(stack, 'Cert', 'arn:${Aws.PARTITION}:acm:us-east-1:123456789012:certificate/11112222-3333-1234-1234-123456789012');

const props: CloudFrontToS3Props = {
cloudFrontDistributionProps: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,11 @@
"Fn::Join": [
"",
[
"arn:aws:cognito-identity:",
"arn:",
{
"Ref": "AWS::Partition"
},
":cognito-identity:",
{
"Ref": "AWS::Region"
},
Expand All @@ -513,7 +517,11 @@
"Fn::Join": [
"",
[
"arn:aws:es:",
"arn:",
{
"Ref": "AWS::Partition"
},
":es:",
{
"Ref": "AWS::Region"
},
Expand Down Expand Up @@ -581,8 +589,12 @@
"Fn::Join": [
"",
[
"arn:aws:es:",
"arn:",
{
"Ref": "AWS::Partition"
},
":es:",
{
"Ref": "AWS::Region"
},
":",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,11 @@
"Fn::Join": [
"",
[
"arn:aws:cognito-identity:",
"arn:",
{
"Ref": "AWS::Partition"
},
":cognito-identity:",
{
"Ref": "AWS::Region"
},
Expand All @@ -443,7 +447,11 @@
"Fn::Join": [
"",
[
"arn:aws:es:",
"arn:",
{
"Ref": "AWS::Partition"
},
":es:",
{
"Ref": "AWS::Region"
},
Expand Down Expand Up @@ -511,8 +519,12 @@
"Fn::Join": [
"",
[
"arn:aws:es:",
"arn:",
{
"Ref": "AWS::Partition"
},
":es:",
{
"Ref": "AWS::Region"
},
":",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ test('Test cognito dashboard role IAM policy', () => {
"Fn::Join": [
"",
[
"arn:aws:cognito-identity:",
"arn:",
{
Ref: "AWS::Partition"
},
":cognito-identity:",
{
Ref: "AWS::Region"
},
Expand All @@ -138,7 +142,11 @@ test('Test cognito dashboard role IAM policy', () => {
"Fn::Join": [
"",
[
"arn:aws:es:",
"arn:",
{
Ref: "AWS::Partition"
},
":es:",
{
Ref: "AWS::Region"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,11 @@
"Fn::Join": [
"",
[
"arn:aws:cognito-identity:",
"arn:",
{
"Ref": "AWS::Partition"
},
":cognito-identity:",
{
"Ref": "AWS::Region"
},
Expand All @@ -1260,7 +1264,11 @@
"Fn::Join": [
"",
[
"arn:aws:es:",
"arn:",
{
"Ref": "AWS::Partition"
},
":es:",
{
"Ref": "AWS::Region"
},
Expand Down Expand Up @@ -1320,8 +1328,12 @@
"Fn::Join": [
"",
[
"arn:aws:es:",
"arn:",
{
"Ref": "AWS::Partition"
},
":es:",
{
"Ref": "AWS::Region"
},
":",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,11 @@
"Fn::Join": [
"",
[
"arn:aws:cognito-identity:",
"arn:",
{
"Ref": "AWS::Partition"
},
":cognito-identity:",
{
"Ref": "AWS::Region"
},
Expand All @@ -238,7 +242,11 @@
"Fn::Join": [
"",
[
"arn:aws:es:",
"arn:",
{
"Ref": "AWS::Partition"
},
":es:",
{
"Ref": "AWS::Region"
},
Expand Down Expand Up @@ -298,8 +306,12 @@
"Fn::Join": [
"",
[
"arn:aws:es:",
"arn:",
{
"Ref": "AWS::Partition"
},
":es:",
{
"Ref": "AWS::Region"
},
":",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,11 @@
"Fn::Join": [
"",
[
"arn:aws:cognito-identity:",
"arn:",
{
"Ref": "AWS::Partition"
},
":cognito-identity:",
{
"Ref": "AWS::Region"
},
Expand All @@ -442,7 +446,11 @@
"Fn::Join": [
"",
[
"arn:aws:es:",
"arn:",
{
"Ref": "AWS::Partition"
},
":es:",
{
"Ref": "AWS::Region"
},
Expand Down Expand Up @@ -510,8 +518,12 @@
"Fn::Join": [
"",
[
"arn:aws:es:",
"arn:",
{
"Ref": "AWS::Partition"
},
":es:",
{
"Ref": "AWS::Region"
},
":",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,11 @@
"Fn::Join": [
"",
[
"arn:aws:cognito-identity:",
"arn:",
{
"Ref": "AWS::Partition"
},
":cognito-identity:",
{
"Ref": "AWS::Region"
},
Expand All @@ -1116,7 +1120,11 @@
"Fn::Join": [
"",
[
"arn:aws:es:",
"arn:",
{
"Ref": "AWS::Partition"
},
":es:",
{
"Ref": "AWS::Region"
},
Expand Down Expand Up @@ -1184,8 +1192,12 @@
"Fn::Join": [
"",
[
"arn:aws:es:",
"arn:",
{
"Ref": "AWS::Partition"
},
":es:",
{
"Ref": "AWS::Region"
},
":",
Expand Down
Loading