Skip to content

Commit ef7070c

Browse files
committed
fix readme
1 parent 1d778c4 commit ef7070c

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

3_ECS_Java_Spring_PetClinic_CICD/infra-automation/deployment-pipeline-codecommit.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ Resources:
202202
### CodePipeline & Codebuild
203203
ArtifactBucket:
204204
Type: AWS::S3::Bucket
205-
Properties:
206-
BucketName: !Sub "${EnvironmentName}-${MicroServiceName}-codepipeline"
205+
# Properties:
206+
# BucketName: !Sub "${EnvironmentName}-${MicroServiceName}-codepipeline"
207207
# Tags:
208208
DeletionPolicy: Retain
209209

3_ECS_Java_Spring_PetClinic_CICD/readme.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,16 @@ In this step, we download the Java Spring PetClinic Microservices from github.co
4141
#Need to change to just grab it from the current project instead of the other folder.
4242
4343
mkdir /tmp/scratch && cd /tmp/scratch
44-
curl https://codeload.github.com/awslabs/amazon-ecs-java-microservices/zip/master -o amazon-ecs-java-microservices-master.zip
45-
#TOFIX: git clone <awslabs github repo of this project> instead?
46-
unzip amazon-ecs-java-microservices-master.zip
44+
#TOFIX: git clone <awslabs github repo of this project>
4745
4846
```
4947

5048
#### Create 5 AWS CodeCommit Repositories for the microservices
5149
```bash
5250
cd amazon-ecs-java-microservices-master/2_ECS_Java_Spring_PetClinic_Microservices
5351

54-
for repo in spring-petclinic-rest-owner spring-petclinic-rest-pet spring-petclinic-rest-system spring-petclinic-rest-vet spring-petclinic-rest-visit
52+
for repo in spring-petclinic-rest-owner spring-petclinic-rest-pet \
53+
spring-petclinic-rest-system spring-petclinic-rest-vet spring-petclinic-rest-visit
5554
do
5655
export gitSSHUrl=$(aws codecommit create-repository --repository-name $repo | \
5756
python -c "import sys, json; print json.load(sys.stdin)['repositoryMetadata']['cloneUrlSsh']")
@@ -173,14 +172,16 @@ The above command will encrypt our database password using KMS key ```alias/aws/
173172
Using AWS Console, navigate to Cloudformation console and launch the following Cloudformation template from your ```$infra_bucket_name``` bucket. Make sure you specific the same database password for the ```DBPassword``` parameter as the one in ```/DeploymentConfig/Prod/DBPassword```.
174173

175174
```bash
175+
176+
export mysshkey=<EC2 SSH Key>
177+
176178
aws cloudformation create-stack --stack-name petclinic-cicd --template-url \
177179
https://s3-$region.amazonaws.com/$infra_bucket_name/master-ecs.yaml --parameters \
178180
ParameterKey=CodeBuildContainerSpringBootDocker,ParameterValue=$account_id.dkr.ecr.$region.amazonaws.com/custombuild:latest \
179181
ParameterKey=InfraAutomationCfnBucket,ParameterValue=$infra_bucket_name \
180-
ParameterKey=KeyPair,ParameterValue=<your sshkeypair> \
181-
ParameterKey=DBPassword,ParameterValue=\
182-
$(aws ssm get-parameters --name /DeploymentConfig/Prod/DBPassword --with-decryption --query Parameters[0].Value --region $region|sed -e 's/\"//g') \
183-
ParameterKey=SsmKMSKeyArn,ParameterValue=<arn_of_alias/aws/ssm> \
182+
ParameterKey=KeyPair,ParameterValue=$mysshkey \
183+
ParameterKey=DBPassword,ParameterValue=$(aws ssm get-parameters --name /DeploymentConfig/Prod/DBPassword --with-decryption --query 'Parameters[0].Value') \
184+
ParameterKey=SsmKMSKeyArn,ParameterValue=$(aws kms describe-key --key-id 'alias/aws/ssm' --query 'KeyMetadata.Arn') \
184185
--capabilities CAPABILITY_IAM
185186

186187
```
@@ -248,15 +249,14 @@ To delete the AWS resources:
248249
- Delete the 5 CodePipeline buckets (S3 console)
249250
- Cloudformation cannot delete an S3 bucket that is not empty. We will delete the bucket manually using AWS Console or AWS CLI
250251
```
251-
aws s3 rb s3://$infra_bucket_name --force
252+
aws s3 rb s3://<infra-automation-bucket-name> --force
252253
```
253254
- Delete the snapshot of RDS (RDS console -> snapshot)
254255
- Delete CodeCommit Repositories
255256

256257

257258
```bash
258-
for repo in spring-petclinic-rest-owner spring-petclinic-rest-pet spring-petclinic-rest-system \
259-
spring-petclinic-rest-vet spring-petclinic-rest-visit
259+
for repo in spring-petclinic-rest-owner spring-petclinic-rest-pet spring-petclinic-rest-system spring-petclinic-rest-vet spring-petclinic-rest-visit
260260
do
261261
aws codecommit delete-repository --repository-name $repo
262262
done

0 commit comments

Comments
 (0)