Base on AWS Code Build documentation, we can pass EnvironmentVariables with PARAMETER_STORE type.
I've ensure the parameter store name is typed correctly and the parameter is exists.
I've tried to login via aws cli but it seem not related and still get wrong result.
Here is my cloudformation yaml snippet:
- Name: Build
Actions:
- Name: HelloWord
ActionTypeId:
Category: Build
Owner: AWS
Provider: CodeBuild
Version: "1"
Configuration:
ProjectName: HelloWoldBuild
EnvironmentVariables:
Fn::Sub:
- '[{"name": "NGINX_BASE_IMAGE_TAG","value": "${NGINX_BASE_IMAGE_TAG}","type": "PARAMETER_STORE"}]
- NGINX_BASE_IMAGE_TAG: "/nginx/base"
and here is my buildspec.yaml snippet:
version: 0.2
phases:
install:
runtime-versions:
docker: 18
pre_build:
commands:
- echo "${NGINX_BASE_IMAGE_TAG}"
When I see the CodeBuild log, the output was '***'. The correct one should be value from my parameter store.
How could it happen ? I still don't get it. I've test with PLAINTEXT type and works well.