Skip to content

Commit

Permalink
Add StackName Tags
Browse files Browse the repository at this point in the history
  • Loading branch information
docwho2 committed Nov 23, 2023
1 parent dfa1912 commit dfa38b0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/cloud/cleo/chimesma/cdk/InfrastructureApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static cloud.cleo.chimesma.cdk.InfrastructureApp.ENV_VARS.*;
import java.util.List;
import java.util.Map;
import software.amazon.awscdk.App;
import software.amazon.awscdk.Environment;
import software.amazon.awscdk.StackProps;
Expand Down Expand Up @@ -56,22 +57,26 @@ public static void main(final String[] args) {
String regionEast = getParamOrDefault(app, "regionEast", "us-east-1");
String regionWest = getParamOrDefault(app, "regionWest", "us-west-2");


final var east = new InfrastructureStack(app, "east", StackProps.builder()
.description(STACK_DESC)
.stackName(stackName)
.tags(Map.of("StackName",stackName))
.env(makeStackEnv(accountId, regionEast))
.build());

final var west = new InfrastructureStack(app, "west", StackProps.builder()
.description(STACK_DESC)
.stackName(stackName)
.tags(Map.of("StackName",stackName))
.env(makeStackEnv(accountId, regionWest))
.build());

if (hasTwilio()) {
new TwilioStack(app, "twilio", StackProps.builder()
.description("Provision Twilio Sip Trunk")
.stackName(stackName + "-twilio")
.tags(Map.of("StackName",stackName + "-twilio"))
.env(makeStackEnv(accountId, regionEast))
.crossRegionReferences(Boolean.TRUE)
.build(), east.getVoiceConnector(), west.getVoiceConnector());
Expand All @@ -83,6 +88,7 @@ public static void main(final String[] args) {
new ChimePhoneNumberStack(app, "phone", StackProps.builder()
.description("Provision Chime Phone Number")
.stackName(stackName + "-phone")
.tags(Map.of("StackName",stackName + "-phone"))
.env(makeStackEnv(accountId, regionEast))
.crossRegionReferences(Boolean.TRUE)
.build(), List.of(east.getSMA(), west.getSMA()));
Expand Down

0 comments on commit dfa38b0

Please sign in to comment.