Skip to content

Commit 0bbcfae

Browse files
committed
get VPC and subnet IDs from CFN
1 parent a2c941a commit 0bbcfae

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

.ebextensions/xray.config

Lines changed: 0 additions & 11 deletions
This file was deleted.

cloudformation/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ include ../aws.env
33
.PHONY: check-region stack clean
44

55
check-region:
6-
test -n "$(AWS_REGION)" || (echo "AWS_REGION must be defined in ../aws.env"; exit 1)
6+
@test -n "$(AWS_REGION)" || (echo "AWS_REGION must be defined in ../aws.env"; exit 1)
77

88
stack: check-region
99
aws --region $(AWS_REGION) cloudformation create-stack --stack-name scorekeep --capabilities "CAPABILITY_NAMED_IAM" --template-body file://cf-resources.yaml
@@ -14,5 +14,10 @@ update: check-region
1414
check: check-region
1515
aws --region $(AWS_REGION) cloudformation describe-stack-events --stack-name scorekeep --max-items 4
1616

17+
outputs: check-region
18+
@aws --region $(AWS_REGION) cloudformation describe-stacks --stack-name scorekeep --query 'Stacks[0].Outputs[?OutputKey==`PubPrivateVPCID`].OutputValue' --output text
19+
@aws --region $(AWS_REGION) cloudformation describe-stacks --stack-name scorekeep --query 'Stacks[0].Outputs[?OutputKey==`PrivateSubnet1ID`].OutputValue' --output text
20+
@aws --region $(AWS_REGION) cloudformation describe-stacks --stack-name scorekeep --query 'Stacks[0].Outputs[?OutputKey==`PrivateSubnet2ID`].OutputValue' --output text
21+
1722
clean: check-region
1823
aws --region $(AWS_REGION) cloudformation delete-stack --stack-name scorekeep

cloudformation/cf-resources.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,3 +292,19 @@ Resources:
292292
Type: "application"
293293
IpAddressType: "ipv4"
294294
DependsOn: ScorekeepLbSecurityGroup
295+
Outputs:
296+
PubPrivateVPCID:
297+
Description: VPC ID
298+
Value: !Ref "PubPrivateVPC"
299+
Export:
300+
Name: ScorekeepVPCID
301+
PrivateSubnet1ID:
302+
Description: Private Subnet A ID
303+
Value: !Ref "PrivateSubnet1"
304+
Export:
305+
Name: ScorekeepPrivateSubnet1ID
306+
PrivateSubnet2ID:
307+
Description: Private Subnet B ID
308+
Value: !Ref "PrivateSubnet2"
309+
Export:
310+
Name: ScorekeepPrivateSubnet2ID

0 commit comments

Comments
 (0)