aws-solutions / aws-control-tower-customizations

The Customizations for AWS Control Tower solution combines AWS Control Tower and other highly-available, trusted AWS services to help customers more quickly set up a secure, multi-account AWS environment using AWS best practices.
https://docs.aws.amazon.com/controltower/latest/userguide/cfct-overview.html
Apache License 2.0
355 stars 205 forks source link

Incorrect parsing parameter_value when value is set to Yes #136

Open lapkritinis opened 1 year ago

lapkritinis commented 1 year ago

Describe the bug When deploying CFT if parameter is specified like this:

      - parameter_key: AssumeRoleRequired
        parameter_value: Yes 

Parameter value gets modified to 'true'

and stack fails to launch due allowed values constraint

To Reproduce Try launch template with such block:

Parameters:
  AssumeRoleRequired:
    Type: String
    AllowedValues:
      - 'No'
      - 'Yes'

Expected behavior It should pick specified value

Please complete the following information about the solution:

balltrev commented 1 year ago

Hey @lapkritinis, I'm not actually able to reproduce this bug. Could you reach out to AWS Premium Support to help you with this issue?

stumins commented 1 year ago

Additional details from: https://github.com/aws-solutions/aws-control-tower-customizations/issues/140

To Reproduce CFT. It works just fine if using AWS Console

AWSTemplateFormatVersion: "2010-09-09"
Description: Demo the issue with "Yes" with CCT

Parameters:
  Selection:
    Type: String
    AllowedValues:
      - 'No'
      - 'Yes'
    Default: 'No'

Conditions:
  SelectedYes: !Equals [ !Ref Selection, 'Yes' ]

Resources:
  S3Bucket:
    Condition: SelectedYes
    Type: AWS::S3::Bucket

Manifest part:

  - name: DemoIssue
    resource_file: templates/Test.yaml
    parameters:
      - parameter_key: Selection
        parameter_value: Yes
    deploy_method: stack_set
    deployment_targets:
      accounts:
        - security

Expected behavior S3 bucket should be created

Instead I get error:

Parameter 'Selection' must be one of AllowedValues