-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
755 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Common stuff between deploy and destroy scripts | ||
|
||
# Stack name for the SMA general deployment | ||
STACK_NAME=chime-sdk-cdk-provisioning | ||
|
||
|
||
# Regions we will deploy to (the only supported US regions for Chime PSTN SDK) | ||
declare -a regions=( us-east-1 us-west-2) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text) | ||
|
||
|
||
cdk deploy -c accountId=${ACCOUNT_ID} -c stackName=${CDK_STACK_NAME} -c regionEast=${regions[0]} -c regionWest=${regions[1]} --concurrency=3 --all --require-approval=never |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
# Stack names and regions | ||
source config.sh | ||
|
||
ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text) | ||
|
||
# Exit immediately if a command exits with a non-zero status. | ||
set -e | ||
cdk destroy -c accountId=${ACCOUNT_ID} --all --force | ||
|
||
set +e | ||
|
||
# delete things in each region | ||
for region in "${regions[@]}"; do | ||
|
||
echo | ||
echo "Deleting Log Groups starting with /aws/lambda/${STACK_NAME} in region ${region}" | ||
declare -a LGS=($(aws logs describe-log-groups --region ${region} --log-group-name-prefix /aws/lambda/${STACK_NAME} --query logGroups[].logGroupName --output text)) | ||
for logGroup in "${LGS[@]}"; do | ||
echo " Delete Log group [${logGroup}]" | ||
aws logs delete-log-group --region ${region} --log-group-name "${logGroup}" > /dev/null | ||
done | ||
|
||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package cloud.cleo.chimesma.cdk; | ||
|
||
import cloud.cleo.chimesma.cdk.twilio.*; | ||
import software.amazon.awscdk.App; | ||
import software.constructs.Construct; | ||
import software.amazon.awscdk.Stack; | ||
import software.amazon.awscdk.StackProps; | ||
|
||
/** | ||
* CDK Stack | ||
* | ||
* @author sjensen | ||
*/ | ||
public class TwilioStack extends Stack { | ||
|
||
/** | ||
* If set in the environment, setup Origination to point to it and allow from termination as well | ||
*/ | ||
private final static String PBX_HOSTNAME = System.getenv("PBX_HOSTNAME"); | ||
|
||
public TwilioStack(final App parent, final String id, String vc1, String vc2) { | ||
this(parent, id, null,vc1,vc2); | ||
} | ||
|
||
public TwilioStack(final Construct parent, final String id, final StackProps props, String vc1, String vc2) { | ||
super(parent, id, props); | ||
|
||
new TwilioSipTrunk(this,vc1, vc2); | ||
new TwilioRule(this); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.