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

Add create-or-update command #55

Closed
jpb opened this issue Jan 23, 2018 · 12 comments
Closed

Add create-or-update command #55

jpb opened this issue Jan 23, 2018 · 12 comments

Comments

@jpb
Copy link
Contributor

jpb commented Jan 23, 2018

Create CLI command to "create or update" a stack (such as iidy apply-stack stack-args.yaml or iidy create-or-update stack-args.yaml).

@tavisrudd
Copy link
Collaborator

or dwim 😛

@tavisrudd
Copy link
Collaborator

After some thought, I prefer create-or-update.

@tavisrudd
Copy link
Collaborator

If we implement this, should we mirror the cli options available to update-stack (--changeset, etc.)?

@rgitzelub
Copy link

rgitzelub commented Feb 27, 2018

+1 to this capability.

@jpb
Copy link
Contributor Author

jpb commented Feb 27, 2018

I think this command should mirror the options for create-stack (at least for the first implementation). If you want more control, you should probably be using update-stack anyway.

@rgitzelub
Copy link

Maybe it just needs to be an option for create-stack, i.e. to not fail if it already exists?

@tavisrudd
Copy link
Collaborator

How about just --changeset? create-changeset also works for creating new stacks.

@rgitzelub
Copy link

It would also be useful for delete-stack to be allowed to succeed if the stack doesn't exist already.

@rgitzelub
Copy link

On a related note, delete-stack has an unhandled rejection in that case:

docker run -v `pwd`:/mnt:ro -v ~/.aws:/root/.aws:ro -e 'STACK_ENV=rodney' unbounce/iidy:latest delete-stack --profile sandbox --region us-west-2 --yes rodney--certificate-processor--ec2-policies-and-roles

Stack Details:
Unhandled rejection ValidationError: Stack: rodney--certificate-processor--ec2-policies-and-roles does not exist
    at Request.extractError (/snapshot/iidy/node_modules/aws-sdk/lib/protocol/query.js:47:29)
    at Request.callListeners (/snapshot/iidy/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at Request.emit (/snapshot/iidy/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/snapshot/iidy/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/snapshot/iidy/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/snapshot/iidy/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /snapshot/iidy/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/snapshot/iidy/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/snapshot/iidy/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/snapshot/iidy/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
    at Request.emit (/snapshot/iidy/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/snapshot/iidy/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/snapshot/iidy/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/snapshot/iidy/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /snapshot/iidy/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/snapshot/iidy/node_modules/aws-sdk/lib/request.js:38:9)
error: Stack with id rodney--certificate-processor--ec2-policies-and-roles does not exist
make: *** [clean] Error 1

@rgitzelub
Copy link

Really what I'm looking for is something akin to Ansible's exists/absent behaviour.

We have deploy-all and destroy-all scripts for groups of our stacks that are failing using iidy, if the stacks aren't either completely all there or all not there.

@cliffpracht
Copy link

+1 this would be super useful.

@tavisrudd
Copy link
Collaborator

PR #101 fixes the delete-stack issue.

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

4 participants