Submit Your Ideas

We want to hear from you - vote for the features and improvements you'd most like to see, or submit your own ideas if you don't find them already listed.

Set AWS Credentials via API

Our Organization used to deploy AWS Environment.

We set AWS credential manually from GUI. But it is troublesome.

I think it is very useful to get create github event and set AWS Permissions via API.

 

 

  • Avatar32.5fb70cce7410889e661286fd7f1897de Guest
  • Jul 23 2018
  • Already exists
API
  • Attach files
  • Admin
    Alexey Klochay commented
    July 25, 2018 14:01

    Thank you for submitting this idea!

    Our AWS Keys settings section is not available on CircleCI 2.0. We suggest configuring AWS CLI via the environment variables as described in the AWS documentation here. It is possible to create environment variables via the API (please see this doc for an example) so using environment variables should help you achieve your goal.

    Please let me know if this helps!

  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    July 28, 2018 01:36

    I try to set command, but get this message.

    `{

      "message" : "You must choose a name for this environment variable"

    }`

     

    I post this command.

    `curl -X POST --header "Content-Type: application/json" -d '[{"Name": "AWS_ACCESS_KEY_ID", "Value":"AKIAIXXXXXXX"}, "Value":"je7MtGbClwBF/2Zp9Utk/h3yCo8nvbireamgpet"}]' --request POST https://circleci.com/api/v1.1/project/github/gh-name/gh-pj-name/envvar?circle-token=<token>`

  • Admin
    Nathan Dintenfass commented
    July 28, 2018 02:49

    It looks like there may be syntax problem and missing key in your payload -- your data structure has a key called AWS_ACCESS_KEY_ID, but then your other value does not have a NAME field:

    `[
    {"Name": "AWS_ACCESS_KEY_ID", "Value":"AKIAIXXXXXXX"},
    "Value":"je7MtGbClwBF/2Zp9Utk/h3yCo8nvbireamgpet"}
    ]`