Skip to content

Commit

Permalink
#82 more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kunduso committed Oct 4, 2024
1 parent cbe854c commit a527015
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions deploy/code_deploy_deployment.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ locals {
}
]
}
appspec_file = replace(jsonencode(local.appspec), "/\"([0-9]+\\.?[0-9]*)\"/", "$1") # remove unnecessary decimal
appspec_sha256 = sha256(jsonencode(local.appspec))
appspec_content = replace(jsonencode(local.appspec), "\"", "\\\"") # remove unnecessary decimal
appspec_sha256 = sha256(jsonencode(local.appspec))

# create deployment script
script = <<EOF
Expand All @@ -28,7 +28,7 @@ ID=$(aws deploy create-deployment \
--application-name ${aws_codedeploy_app.application_main.name} \
--deployment-config-name CodeDeployDefault.OneAtATime \
--deployment-group-name ${aws_codedeploy_deployment_group.application_main.deployment_group_name} \
--appspec-content "$(cat appspec.json)" \
--revision '{"revisionType":"AppSpecContent","appSpecContent":{"content":"'${appspec_content}'","sha256":"'${appspec_sha256}'"}}' \
--description "Deployment from Terraform" \
--output json | jq -r '.deploymentId')
Expand Down

0 comments on commit a527015

Please sign in to comment.