Skip to content

Commit 903143c

Browse files
Fix(core): added region to resolver cleanup and removed second tgw in config (#369)
1 parent 88d03fb commit 903143c

File tree

3 files changed

+5
-122
lines changed

3 files changed

+5
-122
lines changed

reference-artifacts/Custom-Scripts/resolver-rule-cleanup.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
# Domain name to search for resolver rule
44
Domain="dept.cloud-nuage.gc.ca"
5+
region="ca-central-1"
56

67
# Finds the resolver rule Id for the given domain name
78
function get_resolver_id() {
8-
resolver_id=$(aws route53resolver list-resolver-rules --filters Name=DomainName,Values=$Domain --query ResolverRules[].Id --output text)
9+
resolver_id=$(aws route53resolver list-resolver-rules --region $region --filters Name=DomainName,Values=$Domain --query ResolverRules[].Id --output text)
910
}
1011

1112
# Finds VPCs associated to the resolver rule Id
1213
function get_vpc_ids() {
13-
vpc_ids=$(aws route53resolver list-resolver-rule-associations --filters Name=ResolverRuleId,Values=$1 --query ResolverRuleAssociations[].VPCId --output json | awk '{print $1}' | tr -d '[]",')
14+
vpc_ids=$(aws route53resolver list-resolver-rule-associations --region $region --filters Name=ResolverRuleId,Values=$1 --query ResolverRuleAssociations[].VPCId --output json | awk '{print $1}' | tr -d '[]",')
1415
}
1516

1617
# Checks association of VPCs from the resolver rule
@@ -39,7 +40,7 @@ function disassociate_vpc_ids() {
3940
else
4041
echo "started disassociating VPCs from resolver rule $resolver_id"
4142
for vpc_id in $vpc_ids; do
42-
result=$(aws route53resolver disassociate-resolver-rule --resolver-rule-id ${resolver_id} --vpc-id $vpc_id)
43+
result=$(aws route53resolver disassociate-resolver-rule --region $region --resolver-rule-id ${resolver_id} --vpc-id $vpc_id)
4344
done
4445
_checkStatus
4546
fi

reference-artifacts/config.example.json

Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -403,84 +403,7 @@
403403
"Auto-accept-sharing-attachments": true
404404
},
405405
"route-tables": ["core", "segregated", "shared", "standalone"],
406-
"tgw-routes": [
407-
{
408-
"name": "{TGW_ALL}",
409-
"routes": [
410-
{
411-
"destination": "1.1.0.0/32",
412-
"target-tgw": "East"
413-
}
414-
]
415-
},
416-
{
417-
"name": "segregated",
418-
"routes": [
419-
{
420-
"destination": "1.0.4.0/32",
421-
"blackhole-route": true
422-
}
423-
]
424-
},
425-
{
426-
"name": "shared",
427-
"routes": [{
428-
"destination": "1.0.2.0/32",
429-
"target-vpc": "Dev"
430-
}]
431-
},
432-
{
433-
"name": "standalone",
434-
"routes": [{
435-
"destination": "1.0.3.0/32",
436-
"target-vpn": {
437-
"name": "Perimeter_fw",
438-
"az": "b",
439-
"subnet": "Public"
440-
}
441-
}]
442-
}
443-
]
444-
},
445-
{
446-
"name": "East",
447-
"asn": 64526,
448-
"region": "us-east-1",
449-
"features": {
450-
"DNS-support": true,
451-
"VPN-ECMP-support": true,
452-
"Default-route-table-association": false,
453-
"Default-route-table-propagation": false,
454-
"Auto-accept-sharing-attachments": true
455-
},
456-
"route-tables": ["core", "segregated", "shared", "standalone"],
457-
"tgw-attach": {
458-
"associate-to-tgw": "Main",
459-
"account": "shared-network",
460-
"region": "ca-central-1",
461-
"tgw-rt-associate-local": ["core"],
462-
"tgw-rt-associate-remote": ["core"]
463-
},
464-
"tgw-routes": [
465-
{
466-
"name": "core",
467-
"routes": [
468-
{
469-
"destination": "1.1.0.0/32",
470-
"target-tgw": "Main"
471-
}
472-
]
473-
},
474-
{
475-
"name": "segregated",
476-
"routes": [
477-
{
478-
"destination": "1.1.1.0/32",
479-
"target-tgw": "Main"
480-
}
481-
]
482-
}
483-
]
406+
"tgw-routes": []
484407
}
485408
]
486409
}

src/deployments/cdk/test/apps/__snapshots__/unsupported-changed.spec.ts.snap

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,6 @@ exports[`there should not be any unsupported resource changes for AWS::Budgets::
534534

535535
exports[`there should not be any unsupported resource changes for AWS::Budgets::Budget: SharedNetworkPhase0 1`] = `Array []`;
536536

537-
exports[`there should not be any unsupported resource changes for AWS::Budgets::Budget: SharedNetworkPhase0UsEast1 1`] = `Array []`;
538-
539537
exports[`there should not be any unsupported resource changes for AWS::Budgets::Budget: SharedNetworkPhase1 1`] = `
540538
Array [
541539
Object {
@@ -811,8 +809,6 @@ exports[`there should not be any unsupported resource changes for AWS::Directory
811809

812810
exports[`there should not be any unsupported resource changes for AWS::DirectoryService::MicrosoftAD: SharedNetworkPhase0 1`] = `Array []`;
813811

814-
exports[`there should not be any unsupported resource changes for AWS::DirectoryService::MicrosoftAD: SharedNetworkPhase0UsEast1 1`] = `Array []`;
815-
816812
exports[`there should not be any unsupported resource changes for AWS::DirectoryService::MicrosoftAD: SharedNetworkPhase1 1`] = `Array []`;
817813

818814
exports[`there should not be any unsupported resource changes for AWS::DirectoryService::MicrosoftAD: SharedNetworkPhase1Endpoint0CD50B8FF 1`] = `Array []`;
@@ -1076,8 +1072,6 @@ exports[`there should not be any unsupported resource changes for AWS::EC2::Inst
10761072

10771073
exports[`there should not be any unsupported resource changes for AWS::EC2::Instance: SharedNetworkPhase0 1`] = `Array []`;
10781074

1079-
exports[`there should not be any unsupported resource changes for AWS::EC2::Instance: SharedNetworkPhase0UsEast1 1`] = `Array []`;
1080-
10811075
exports[`there should not be any unsupported resource changes for AWS::EC2::Instance: SharedNetworkPhase1 1`] = `Array []`;
10821076

10831077
exports[`there should not be any unsupported resource changes for AWS::EC2::Instance: SharedNetworkPhase1Endpoint0CD50B8FF 1`] = `Array []`;
@@ -1211,33 +1205,6 @@ Array [
12111205
]
12121206
`;
12131207

1214-
exports[`there should not be any unsupported resource changes for AWS::EC2::TransitGateway: SharedNetworkPhase0UsEast1 1`] = `
1215-
Array [
1216-
Object {
1217-
"LogicalId": "TgwEast2B76AF66",
1218-
"Properties": Object {
1219-
"AmazonSideAsn": 64526,
1220-
"AutoAcceptSharedAttachments": "enable",
1221-
"DefaultRouteTableAssociation": "disable",
1222-
"DefaultRouteTablePropagation": "disable",
1223-
"Description": undefined,
1224-
"DnsSupport": "enable",
1225-
"Tags": Array [
1226-
Object {
1227-
"Key": "Accelerator",
1228-
"Value": "PBMM",
1229-
},
1230-
Object {
1231-
"Key": "Name",
1232-
"Value": "East_tgw",
1233-
},
1234-
],
1235-
"VpnEcmpSupport": "enable",
1236-
},
1237-
},
1238-
]
1239-
`;
1240-
12411208
exports[`there should not be any unsupported resource changes for AWS::EC2::TransitGateway: SharedNetworkPhase1 1`] = `Array []`;
12421209

12431210
exports[`there should not be any unsupported resource changes for AWS::EC2::TransitGateway: SharedNetworkPhase1Endpoint0CD50B8FF 1`] = `Array []`;
@@ -1367,8 +1334,6 @@ exports[`there should not be any unsupported resource changes for AWS::ElasticLo
13671334

13681335
exports[`there should not be any unsupported resource changes for AWS::ElasticLoadBalancingV2::LoadBalancer: SharedNetworkPhase0 1`] = `Array []`;
13691336

1370-
exports[`there should not be any unsupported resource changes for AWS::ElasticLoadBalancingV2::LoadBalancer: SharedNetworkPhase0UsEast1 1`] = `Array []`;
1371-
13721337
exports[`there should not be any unsupported resource changes for AWS::ElasticLoadBalancingV2::LoadBalancer: SharedNetworkPhase1 1`] = `Array []`;
13731338

13741339
exports[`there should not be any unsupported resource changes for AWS::ElasticLoadBalancingV2::LoadBalancer: SharedNetworkPhase1Endpoint0CD50B8FF 1`] = `Array []`;
@@ -1564,8 +1529,6 @@ exports[`there should not be any unsupported resource changes for AWS::S3::Bucke
15641529

15651530
exports[`there should not be any unsupported resource changes for AWS::S3::Bucket: SharedNetworkPhase0 1`] = `Array []`;
15661531

1567-
exports[`there should not be any unsupported resource changes for AWS::S3::Bucket: SharedNetworkPhase0UsEast1 1`] = `Array []`;
1568-
15691532
exports[`there should not be any unsupported resource changes for AWS::S3::Bucket: SharedNetworkPhase1 1`] = `
15701533
Array [
15711534
Object {
@@ -1761,8 +1724,6 @@ exports[`there should not be any unsupported resource changes for AWS::SecretsMa
17611724

17621725
exports[`there should not be any unsupported resource changes for AWS::SecretsManager::ResourcePolicy: SharedNetworkPhase0 1`] = `Array []`;
17631726

1764-
exports[`there should not be any unsupported resource changes for AWS::SecretsManager::ResourcePolicy: SharedNetworkPhase0UsEast1 1`] = `Array []`;
1765-
17661727
exports[`there should not be any unsupported resource changes for AWS::SecretsManager::ResourcePolicy: SharedNetworkPhase1 1`] = `Array []`;
17671728

17681729
exports[`there should not be any unsupported resource changes for AWS::SecretsManager::ResourcePolicy: SharedNetworkPhase1Endpoint0CD50B8FF 1`] = `Array []`;
@@ -1940,8 +1901,6 @@ exports[`there should not be any unsupported resource changes for AWS::SecretsMa
19401901

19411902
exports[`there should not be any unsupported resource changes for AWS::SecretsManager::Secret: SharedNetworkPhase0 1`] = `Array []`;
19421903

1943-
exports[`there should not be any unsupported resource changes for AWS::SecretsManager::Secret: SharedNetworkPhase0UsEast1 1`] = `Array []`;
1944-
19451904
exports[`there should not be any unsupported resource changes for AWS::SecretsManager::Secret: SharedNetworkPhase1 1`] = `Array []`;
19461905

19471906
exports[`there should not be any unsupported resource changes for AWS::SecretsManager::Secret: SharedNetworkPhase1Endpoint0CD50B8FF 1`] = `Array []`;

0 commit comments

Comments
 (0)