Giter Club home page Giter Club logo

cfn-create-or-update's People

Contributors

alex-stewart-hermes avatar btisdall avatar joshuanapoli avatar michaelwittig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cfn-create-or-update's Issues

Support --cli-input-json

I'm currently parsing AWS CLI output to ignore No updates are to be performed from the error output while failing on anything else. It's a hack, so cfn-create-or-update is very welcome. I made a "universal" updating script to keep Parameters and Capabilities the same for when I'm only updating the template. It currently works something like this:

# A previous step uploads template file to $S3CfnSource ...

CFN_STACK_JSON="$( aws --region "${REGION:?}" cloudformation describe-stacks --stack-name "${CFN_STACK:?}" | jq -M '.Stacks[0] | {Parameters:.Parameters,Capabilities:.Capabilities} | del(.Parameters[].ParameterValue) | .Parameters[] |= .+ {UsePreviousValue: true}' )"

aws --region "${REGION:?}" \
    cloudformation \
    update-stack \
    --stack-name "${CFN_STACK:?}" \
    --template-url "https://s3.amazonaws.com/${S3CfnSource:?}/${CFN_SOURCE:?}" \
    --cli-input-json "${CFN_STACK_JSON:?}"

Because it's possible to have a stack without parameters or capabilities, I can use --cli-input-json to pass when I do have values and the input will be valid even when the JSON does not contain values for those items. If you could include support for --cli-input-json, I would be able to drop your script in place and remove the nonsense I currently use to parse the error output. Thanks!

Feature Request: Don't return until action is successful

Works like a dream, however it will return success the moment it it performs the function with aws. Any interesting in extending/adding a flag, that will tell it to not return until the action against the stack is a success?

Parameter --wait does not work

Hey,
great work until now but I found that the wait parameter does not work as its ignored in cli.js. This is probably due to a missing assignment in the cli.js.

Adding:

if (has('wait')) {
  args.wait = string('wait');
}

In line 125 of cli.js will probably solve the issue.

Thanks

Concurrent Create/Updates are throttled causing non-zero exit code

Experiencing this issue when I'm running multiple create or updates concurrently.

Resource is not in the state stackUpdateComplete Throttling: Resource is not in the state stackUpdateComplete at Request.extractError (/usr/lib/node_modules/cfn-create-or-update/node_modules/aws-sdk/lib/protocol/query.js:47:29) at Request.callListeners (/usr/lib/node_modules/cfn-create-or-update/node_modules/aws-sdk/lib/sequential_executor.js:105:20) at Request.emit (/usr/lib/node_modules/cfn-create-or-update/node_modules/aws-sdk/lib/sequential_executor.js:77:10) at Request.emit (/usr/lib/node_modules/cfn-create-or-update/node_modules/aws-sdk/lib/request.js:673:14) at Request.transition (/usr/lib/node_modules/cfn-create-or-update/node_modules/aws-sdk/lib/request.js:22:10) at AcceptorStateMachine.runTo (/usr/lib/node_modules/cfn-create-or-update/node_modules/aws-sdk/lib/state_machine.js:14:12) at /usr/lib/node_modules/cfn-create-or-update/node_modules/aws-sdk/lib/state_machine.js:26:10 at Request.<anonymous> (/usr/lib/node_modules/cfn-create-or-update/node_modules/aws-sdk/lib/request.js:38:9) at Request.<anonymous> (/usr/lib/node_modules/cfn-create-or-update/node_modules/aws-sdk/lib/request.js:675:12) at Request.callListeners (/usr/lib/node_modules/cfn-create-or-update/node_modules/aws-sdk/lib/sequential_executor.js:115:18)

The reality is, the cloudformation stack was created/updated successfully - but due to the CLI exiting non-zero, our pipeline task fails.

Is there any way to reuse the existing parameters when updating?

I am getting the following:
cfn-create-or-update --stack-name wordpress-ha --template-body file://wordpress-ha-aurora.yaml --region us-east-1
Parameters: [BlogAdminPassword, DomainName, ParentVPCStack, CloudFrontAcmCertificate, BlogAdminEMail, ElbAcmCertificate] must have values ValidationError: Parameters: [BlogAdminPassword, DomainName, ParentVPCStack, CloudFrontAcmCertificate, BlogAdminEMail, ElbAcmCertificate] must have values
at Request.extractError (/usr/local/lib/node_modules/cfn-create-or-update/node_modules/aws-sdk/lib/protocol/query.js:47:29)
at Request.callListeners (/usr/local/lib/node_modules/cfn-create-or-update/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
at Request.emit (/usr/local/lib/node_modules/cfn-create-or-update/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
at Request.emit (/usr/local/lib/node_modules/cfn-create-or-update/node_modules/aws-sdk/lib/request.js:673:14)
at Request.transition (/usr/local/lib/node_modules/cfn-create-or-update/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/cfn-create-or-update/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /usr/local/lib/node_modules/cfn-create-or-update/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request. (/usr/local/lib/node_modules/cfn-create-or-update/node_modules/aws-sdk/lib/request.js:38:9)
at Request. (/usr/local/lib/node_modules/cfn-create-or-update/node_modules/aws-sdk/lib/request.js:675:12)
at Request.callListeners (/usr/local/lib/node_modules/cfn-create-or-update/node_modules/aws-sdk/lib/sequential_executor.js:115:18)


I guess it's asking to provide the required parameters. Is there any option to pass the option such "use the existing ones"?

Issue passing string array parameters

sudo /usr/bin/cfn-create-or-update --stack-name sample --template-body file://Tomcat-app-cfn.yaml --region us-east-1 --parameters ParameterKey=KeyName,ParameterValue=rg-newkey ParameterKey=AppURL,ParameterValue=http://localhost/app.war ParameterKey=VPCId,ParameterValue=vpc-12345 ParameterKey=EC2Subnets,ParameterValue="subnet-123456,subnet-789109"
When I run this command it throws error _parameters[3] ParameterKey, ParameterValue or UsePreviousValue expected
_ for EC2Subnets Parameter. whereas the aws cloudformation create-stack command works with same value.

Please let me know what's the right syntax to pass array or list parameter values.

Just upgraded to 1.4.0 and previously working boolean arg (--wait) now fails

Running a script with --wait after upgrade to 1.4.0 gives the following result. No issues running this command in 1.3.0.

Command:
cfn-create-or-update --stack-name whatever --template-body file://dist/cloud-formation/thing.yml --capabilities CAPABILITY_NAMED_IAM --wait

also tried --wait true and --wait "true"

All returned the same error.

YError: Invalid first argument. Expected boolean or string but received function.
    at argumentTypeError (/home/travis/.nvm/versions/node/v8.12.0/lib/node_modules/cfn-create-or-update/node_modules/yargs/lib/argsert.js:65:9)
    at parsed.optional.forEach (/home/travis/.nvm/versions/node/v8.12.0/lib/node_modules/cfn-create-or-update/node_modules/yargs/lib/argsert.js:47:39)
    at Array.forEach (<anonymous>)
    at argsert (/home/travis/.nvm/versions/node/v8.12.0/lib/node_modules/cfn-create-or-update/node_modules/yargs/lib/argsert.js:42:21)
    at Object.version (/home/travis/.nvm/versions/node/v8.12.0/lib/node_modules/cfn-create-or-update/node_modules/yargs/yargs.js:778:5)
    at Object.exports.parse (/home/travis/.nvm/versions/node/v8.12.0/lib/node_modules/cfn-create-or-update/lib/arg.js:28:6)
    at Object.<anonymous> (/home/travis/.nvm/versions/node/v8.12.0/lib/node_modules/cfn-create-or-update/cli.js:20:30)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.