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

deploy_autotag.sh should not error when run more than once #124

Open
robertwilkinson9 opened this issue Jan 9, 2024 · 1 comment
Open

Comments

@robertwilkinson9
Copy link

[cloudshell-user@ip-10-4-67-153 ~]$ ./src/auto-tag/deploy_autotag.sh -r eu-west-2 --s3-bucket rw20240109-autotag-bucket create --custom-tags {"AutoTag_ManagedBy": "The Boss"}
    _______       __         _______
   |   _   .--.--|  |_.-----|       .---.-.-----.
   |.  1   |  |  |   _|  _  |.|   | |  _  |  _  |
   |.  _   |_____|____|_____`-|.  |-|___._|___  |
   |:  |   |                  |:  |       |_____|
   |::.|:. |                  |::.|
   `--- ---'                  `---'


******
****** Create Stacks
******

Which release version would you like to deploy? [0.5.10]: 0.5.9
The rw20240109-autotag-bucket S3 Bucket already exists, skipping bucket create
Initializing AutoTag release version 0.5.9
RELEASE_URL_QUERY is       .[] | select(.name = "0.5.9") |
      .assets[] | select( .name == "autotag-0.5.9.zip") |
      .browser_download_url
GITHUB_API_RELEASES_URL is https://api.github.com/repos/GorillaStack/auto-tag/releases
RELEASE_ZIP_FILE_URL is https://github.com/GorillaStack/auto-tag/releases/download/0.5.9/autotag-0.5.9.zip
Creating the Main CloudFormation Stack...

An error occurred (AlreadyExistsException) when calling the CreateStack operation: Stack [AutoTag] already exists
[cloudshell-user@ip-10-4-67-153 ~]$

This is the second run, I expected it not to error but to say everything was deployed but I see an error.

The S3 bucket is correctly identified and not re-created, but then ....

@robertwilkinson9 robertwilkinson9 changed the title deploy_autotag.sh should be idempotent deploy_autotag.sh should not error when run more than once Jan 9, 2024
@rayjanoka
Copy link
Collaborator

if it is already created you'll need to use one of the update actions instead of using create.

Commands:
    create                    Create the AutoTag infrastructure
    delete                    Delete the AutoTag infrastructure
    update-release            Update the AutoTag infrastructure with a specific release version
    update-master             Update the AutoTag infrastructure with the latest from the master branch
    update-local              Update the AutoTag infrastructure with the local source code

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

No branches or pull requests

2 participants