Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deck/cloudformation): Invalid default name for CloudFormation changeSet #10057

Merged
merged 2 commits into from
Nov 30, 2023

Conversation

dprangnell
Copy link
Contributor

@dprangnell dprangnell commented Oct 27, 2023

spinnaker/spinnaker#6889

Issue Summary:

When you use the "Deploy (CloudFormation Stack)", the default name for the CloudFormation ChangeSet is invalid, this prevents the stage from succeeding.

Cloud Provider(s):

n/a

Environment:

n/a

Feature Area:

Amazon -> "Deploy (CloudFormation Stack)"

Description:

The default CloudFormation changeSet name has a space in it and is invalid. The code is on this line:

    (stage as any).changeSetName ? (stage as any).changeSetName : "ChangeSet-${ execution['id']}",

Notice there is a space before "execution" in the ChangeSetName: ChangeSet-${ execution['id']]"

This is an invalid name and the pipeline fails. Without the space it works, it should be changed to:

    (stage as any).changeSetName ? (stage as any).changeSetName : "ChangeSet-${execution['id']}",

Steps to Reproduce:

  1. Configure an existing or new pipeline
  2. Select a region for the stack
  3. Add stage -> "Deploy (CloudFormation Stack)"
  4. Pick an account
  5. Create a Stack name such as "test"
  6. Tick the box "Create CloudFormation ChangeSet"
  7. Under "Source" select "Text" and enter sample CloudFormation code (such as below, or any other).
AWSTemplateFormatVersion: '2010-09-09'
Description: Creates s3 bucket to test cloudformation.
Outputs:
  WebsiteURL:
    Description: URL for website hosted on S3
    Value:
      'Fn::GetAtt':
        - S3Bucket
        - WebsiteURL
Resources:
  S3Bucket:
    Properties:
      BucketName: test1341243141
      PublicAccessBlockConfiguration:
        BlockPublicAcls: false
        BlockPublicPolicy: false
        IgnorePublicAcls: false
        RestrictPublicBuckets: false
    Type: 'AWS::S3::Bucket'

Run the pipeline and get the following error:

Exception ( Monitor Cloud Formation )

1 validation error detected: Value null at 'changeSetName' failed to satisfy constraint: Member must not be null (Service: > AmazonCloudFormation; Status Code: 400; Error Code: ValidationError; Request ID: 4d249ee8-52bb-416d-9c95-1b0367ac3b2e; Proxy: null)

Additional Details:

n/a

@spinnakerbot
Copy link
Contributor

The following commits need their title changed:

  • 6537a97: Correct invalid changeset name

Please format your commit title into the form:

<type>(<scope>): <subject>, e.g. fix(kubernetes): address NPE in status check

This allows us to easily generate changelogs & determine semantic version numbers when cutting releases. You can read more about commit conventions here.

@dprangnell dprangnell changed the title Correct invalid changeset name fix(deck/cloudformation): Invalid default name for CloudFormation changeSet Oct 27, 2023
@mattgogerly
Copy link
Member

@Mergifyio update

Copy link
Contributor

mergify bot commented Nov 29, 2023

update

❌ Mergify doesn't have permission to update

For security reasons, Mergify can't update this pull request. Try updating locally.
GitHub response: refusing to allow a GitHub App to create or update workflow .github/workflows/build.yml without workflows permission

@mattgogerly
Copy link
Member

@dprangnell mind pulling master in so I can get this merged?

@dprangnell
Copy link
Contributor Author

Thanks @mattgogerly, I've updated this branch with master.

@mattgogerly mattgogerly added the ready to merge Reviewed and ready for merge label Nov 30, 2023
@mergify mergify bot added the auto merged Merged automatically by a bot label Nov 30, 2023
@mergify mergify bot merged commit 94a80c6 into spinnaker:master Nov 30, 2023
4 checks passed
@dprangnell dprangnell deleted the patch-1 branch November 30, 2023 19:21
sahititarigoppula pushed a commit to OpsMx/deck-oes that referenced this pull request Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merged Merged automatically by a bot ready to merge Reviewed and ready for merge target-release/1.33
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants