Giter Site home page Giter Site logo

Comments (6)

rodolfoIOET avatar rodolfoIOET commented on June 12, 2024 1

@kelvintaywl, sorry I forgot to update. To solve this, I used aws-cli solely as a workaround (without aws-s3). I haven't tried the suggested solution by @kelvintaywl

from aws-s3-orb.

qops1981 avatar qops1981 commented on June 12, 2024 1

@kelvintaywl This worked to unblock me! Thank you very much.

from aws-s3-orb.

kelvintaywl avatar kelvintaywl commented on June 12, 2024

Hi @rodolfoIOET

would your project on CircleCI be a private repository?
If so, can you submit a support ticket here @ https://circleci.zendesk.com/hc/en-us/requests/new ?
From there, we (Support team) can dig deeper and look at your CircleCI build to advise further.

Thank you!

from aws-s3-orb.

qops1981 avatar qops1981 commented on June 12, 2024

I am running into the same thing. For me! it looks like when you pass the when: parameter in IT IS NOT passing to the "Install AWS CLI - latest" AND "Configure AWS Access Key ID" steps. These steps are notably missing when the step before fails.

      - run:
          name: "Check the pre-existence of the deploy"
          command: |
            echo "${DEPLOY_PATH}"
            sideshow staging is_deployed ${DEPLOY_PATH}
      - when:
          condition:
            equal: [ master, << pipeline.git.branch >> ]
          steps:
            - backup_deploy:
                bucket: staging
                current: "${DEPLOY_PATH}"
                when: on_success
      - aws-s3/copy:
          arguments: |
            --cache-control "public, max-age=15" \
            --acl bucket-owner-full-control
          from: build/code-snippet.js # build/${FILENAME}
          to: "s3://staging/sideshow/${DEPLOY_PATH}"
          when: always

image

from aws-s3-orb.

kelvintaywl avatar kelvintaywl commented on June 12, 2024

hi @qops1981 @rodolfoIOET, thanks for reporting this.

I believe the issue is because:

  • currently, the aws-s3/copy command does not propagate its when parameter to aws-cli/setup:
    - when:
    condition: <<parameters.install-aws-cli>>
    steps:
    - when:
    condition: <<parameters.role-arn>>
    steps:
    - aws-cli/setup:
    role-arn: <<parameters.role-arn>>
    profile-name: <<parameters.profile-name>>
    session-duration: <<parameters.session-duration>>
    aws-region: <<parameters.aws-region>>
    role-session-name: <<parameters.role-session-name>>
    - unless:
    condition: <<parameters.role-arn>>
    steps:
    - aws-cli/setup:
    aws-access-key-id: << parameters.aws-access-key-id >>
    aws-secret-access-key: << parameters.aws-secret-access-key >>
    aws-region: << parameters.aws-region >>
    profile-name: << parameters.profile-name >>
  • this means that when aws-s3/copy is used with when: on_fail or when: always, if the earlier step before aws-s3/copy failed, this internal aws-cli/setup step will not run since the last step exited non-zero

To solve this, i think we would need to propagate the when parameter value to aws-cli/setup.
We would then expect the aws-cli/setup to also respect this when value.

However, this is tricky too, since the aws-cli/setup command does not currently accept a when parameter:
https://circleci.com/developer/orbs/orb/circleci/aws-cli#commands-setup

This likely requires some coordination on our team (CircleCI) to update both Orbs.

In the meantime, to unblock your cases, we can pre-emptively install the AWS CLI first.
As such, can you try to modify your .circleci/config.yml as shown below?

# snippet; incomplete .circleci/config.yml

orbs:
  aws-s3: circleci/[email protected]
+ aws-cli: circleci/[email protected]
  
jobs:
  example:
    docker:
      - image: cimg/python:3.10
    steps:
+     - aws-cli/setup
      - run: echo "some required commands that may fail"
      - aws-s3/copy:
-         install-aws-cli: true
+         install-aws-cli: false
           # or, when: always
           when: on_fail
          ...

from aws-s3-orb.

brivu avatar brivu commented on June 12, 2024

Hey All!

We've come out with a new standard for all AWS orbs where a user will be required to authenticate first. This means that you'll have to run the aws-cli/setup command first to authenticate first before using any of the S3 commands.

Thanks @kelvintaywl for your guidance!

Best,
Brian

from aws-s3-orb.

Related Issues (20)

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.