Skip to content

Commit db88b52

Browse files
committed
added self-setup via cf
1 parent a1a55e8 commit db88b52

File tree

1 file changed

+17
-30
lines changed

1 file changed

+17
-30
lines changed

Diff for: setup/cloud9.yaml

+17-30
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@ Parameters:
66
Type: String
77
Default: "javaawslambda"
88

9-
GitSourceRepository:
10-
Description: Git repository url for sources
11-
Type: String
12-
13-
GitTag:
14-
Description: Git tag to be cloned from GitSourceRepository
15-
Type: String
16-
179
VpcCIDR:
1810
Description: Please enter the IP range (CIDR notation) for this VPC
1911
Type: String
@@ -543,23 +535,23 @@ Resources:
543535
- action: aws:runShellScript
544536
name: C9bootstrap
545537
inputs:
546-
mand:
547-
- "#!/bin/bash"
548-
- date
549-
- echo LANG=en_US.utf-8 >> /etc/environment
550-
- echo LC_ALL=en_US.UTF-8 >> /etc/environment
551-
- . /home/ubuntu/.bashrc
552-
- echo '=== Clone Git repository ==='
553-
- !Sub sudo -H -u ubuntu bash -c "git clone --depth 1 --branch ${GitTag} ${GitSourceRepository} /home/ubuntu/environment/aws-lambda-java-workshop/"
554-
- echo '=== Update and install default software components, resize disk ==='
555-
- sudo -H -i -u ubuntu bash -c "/home/ubuntu/environment/aws-lambda-java-workshop/setup-cloud9.sh &>> /home/ubuntu/java-ws-c9setup.log"
556-
- echo '=== Setup infrastructure components ==='
557-
- sudo -H -i -u ubuntu bash -c "cd /home/ubuntu/environment/aws-lambda-java-workshop/labs/unicorn-store/ && ./setup-infrastructure.sh &>> /home/ubuntu/java-ws-infrasetup.log"
558-
- echo '=== Install cfn-signal and report status ==='
559-
- pip3 install https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz
560-
- if [ "$?" -ne 0 ]; then export BOOTSTRAP_RESULT=false; else export BOOTSTRAP_RESULT=true; fi
561-
- "cfn-signal -e $? -s $BOOTSTRAP_RESULT '{{ WaitHandleUrl }}' "
562-
- echo "Bootstrap completed with return code $?"
538+
runCommand:
539+
- "#!/bin/bash"
540+
- date
541+
- echo LANG=en_US.utf-8 >> /etc/environment
542+
- echo LC_ALL=en_US.UTF-8 >> /etc/environment
543+
- . /home/ubuntu/.bashrc
544+
- echo '=== Clone Git repository ==='
545+
- !Sub sudo -H -u ubuntu bash -c "git clone https://github.com/aws-samples/aws-lambda-java-workshop.git /home/ubuntu/environment/aws-lambda-java-workshop/"
546+
- echo '=== Update and install default software components, resize disk ==='
547+
- sudo -H -i -u ubuntu bash -c "/home/ubuntu/environment/aws-lambda-java-workshop/setup-cloud9.sh &>> /home/ubuntu/java-ws-c9setup.log"
548+
- echo '=== Setup infrastructure components ==='
549+
- sudo -H -i -u ubuntu bash -c "cd /home/ubuntu/environment/aws-lambda-java-workshop/labs/unicorn-store/ && ./setup-infrastructure.sh &>> /home/ubuntu/java-ws-infrasetup.log"
550+
- echo '=== Install cfn-signal and report status ==='
551+
- pip3 install https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz
552+
- if [ "$?" -ne 0 ]; then export BOOTSTRAP_RESULT=false; else export BOOTSTRAP_RESULT=true; fi
553+
- "cfn-signal -e $? -s $BOOTSTRAP_RESULT '{{ WaitHandleUrl }}' "
554+
- echo "Bootstrap completed with return code $?"
563555

564556
C9BootstrapAssociation:
565557
Type: AWS::SSM::Association
@@ -595,11 +587,6 @@ Resources:
595587
InstanceType:
596588
Ref: C9InstanceType
597589
Name: java-on-aws-lambda-workshop
598-
OwnerArn: !Join
599-
- ''
600-
- - 'arn:aws:iam::'
601-
- !Ref "AWS::AccountId"
602-
- ':assumed-role/WSParticipantRole/Participant'
603590
Tags:
604591
-
605592
Key: SSMBootstrap

0 commit comments

Comments
 (0)