Skip to content

Impossible to generate correct parameter overrides #566

@mindstorms6

Description

@mindstorms6

(TIL enter creates the issue! - actual issue incoming)

When creating a code pipeline with a CloudFormation action - we have a handy prop called paramterOverrides which takes { [name: string]: any };. Customers would use this to feed parameter configuration to a CloudFormation action when not using a template configuration file.

The correct configuration for this value is a JSON object (string):

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/continuous-delivery-codepipeline-action-reference.html

(Shamelessly stolen from this example: https://github.com/quarryman/AWSfrontendCI/blob/2dab0c0e4424258f9c5864885d5dfc6498dd080b/serverless-pipeline.yaml#L217 )

Configuration: 
                ActionMode: CHANGE_SET_REPLACE
                Capabilities: CAPABILITY_IAM
                ChangeSetName: !Sub '${ServiceName}-ChangeSet-Beta'
                ParameterOverrides: "{ \"SourceBucket\" : { \"Fn::GetArtifactAtt\" : [\"BetaBuiltZip\", \"BucketName\"]}, \"SourceArtifact\" : { \"Fn::GetArtifactAtt\" : [\"BetaBuiltZip\", \"ObjectKey\"]} }"
                RoleArn: !GetAtt CloudFormationExecutionRole.Arn
                StackName: !Sub '${ServiceName}-Stack-Beta'
                TemplatePath: !Sub 'BetaBuiltZip::app-output_sam.yaml'

However, we generate an object:

ParameterOverrides:
  CodeBuildBucket: {"Fn::GetArtifactAtt":["BuildOutput","BucketName"]}
  CodeBuildKey: {"Fn::GetArtifactAtt":["BuildOutput","ObjectKey"]}

I believe we just need to call JSON.stringify() the passed values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions