I have created a codebuild solution. It is able to create stack when the parameters are assigned in the template.yml file. But when the parameters are defined into a separate file, unable to create the Changeset.
I have added TEMPLATE_PATH = template.yml and PARAM_FILE_NAME = param.json in codebuild environment variable.
template.yml look like ---->
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: CloudFormation template to create lambda layer
Parameters:
pPyPackageBucket:
Type: String
Description: S3 Bucket for software lib package
Resources:
LambdaLayer:
Type: 'AWS::Lambda::LayerVersion'
Properties:
CompatibleRuntimes:
- 'python3.9'
Content:
S3Bucket: !Ref pPyPackageBucket
S3Key: 'package/python.zip'
Description: 'Python package'
LayerName: 'pandas'
param.json look like ---->
{
"Parameters": {
"pPyPackageBucket": "s3-my-softwares"
},
"StackPolicy": {}
}
buildspec.yml look like ---->
version: 0.2
phases:
pre_build:
commands:
- . ${CODEBUILD_SRC_DIR}/build-scripts/pre_build.sh
build:
commands:
- . ${CODEBUILD_SRC_DIR}/build-scripts/build.sh
artifacts:
files:
- ${TEMPLATE_PATH}
- ${PARAM_FILE_NAME}
discard-paths: no
Getting the below codebuild error:
Failed to create changeset for the stack: cicd_lambda_layer, An error occurred (ValidationError) when calling the CreateChangeSet operation: Parameters: [pPyPackageBucket] must have values.
How to resolve this issue?