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: Update messages when deploying a changeset when importing resources #646

Conversation

haytok
Copy link
Contributor

@haytok haytok commented Feb 24, 2025

Suppose we have a changeset that imports the resource (ex. a RDS DB instance).

```
$ ./rain ls rms-8-0-34 -c rms-8-0-34-changeset-v0
Arn: ***
Created: 2025-02-24 15:26:03.717 +0000 UTC
Description:
Status: AVAILABLE/CREATE_COMPLETE (Verify that resources and their properties defined in the template match the intended configuration of the resource import to avoid unexpected changes.)
Parameters: (None)
Changes:
Import [Replace]: RDSforMySQL (AWS::RDS::DBInstance) rms-8-0-40-created-by-cfn
```

When we try to execute a changeset using the rain deploy command, we get the following failed deploying stack message.

```
$ rain deploy --changeset rms-8-0-34 rms-8-0-34-changeset-v0
Executing changeset 'rms-8-0-34-changeset-v0' as stack 'rms-8-0-34' in ap-northeast-1.
Stack rms-8-0-34: IMPORT_COMPLETE
failed deploying stack 'rms-8-0-34'
```

However, in the case of IMPORT_COMPLETE, the resource is in fact successfully imported.

To avoid confusing users with this message, this PR modifies the message displayed.

Issue #, if available: nothing

Description of changes: Details are above.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Suppose we have a changeset that imports the resource (ex. a RDS DB instance).

    ```bash
    $ ./rain ls rms-8-0-34 -c rms-8-0-34-changeset-v0
    Arn: ***
    Created: 2025-02-24 15:26:03.717 +0000 UTC
    Description:
    Status: AVAILABLE/CREATE_COMPLETE (Verify that resources and their properties defined in the template match the intended configuration of the resource import to avoid unexpected changes.)
    Parameters: (None)
    Changes:
    Import [Replace]: RDSforMySQL (AWS::RDS::DBInstance) rms-8-0-40-created-by-cfn
    ```

When we try to execute a changeset using the rain deploy command, we get
the following “failed deploying stack” message.

    ```
    $ rain deploy --changeset rms-8-0-34 rms-8-0-34-changeset-v0
    Executing changeset 'rms-8-0-34-changeset-v0' as stack 'rms-8-0-34' in ap-northeast-1.
    Stack rms-8-0-34: IMPORT_COMPLETE
    failed deploying stack 'rms-8-0-34'
    ```

However, in the case of IMPORT_COMPLETE, the resource is in fact
successfully imported.

To avoid confusing users with this message, this PR modifies the message
displayed.

Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
@ericzbeard ericzbeard merged commit 8e33538 into aws-cloudformation:main Feb 24, 2025
1 check passed
@haytok haytok deleted the update_messages_in_deploy_changeset_for_import_resource branch February 25, 2025 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants