0

I'm using AWS CodeArtifact to store Python packages. I really like CodeArtifact concept. For Source code repository I use Bitbucket. I'd like to automate things and involve Bitbucket Pipeline to build package and upload it to CodeArtifact.

Unfortunately I'm new to this topic of pipelines and I don't see any integration for AWS CodeArtifact. Is there any person who did it? If yes, how to do it?

Marek
  • 82
  • 6

1 Answers1

0

I encourage you to use some OpenID Connect (OIDC) solution. It is quite easy found some tutorial.

About AWS CodeArtifact I had the same issue and I create my own pipe to authenticate. Maybe It can help you

- step:
    oidc: true
    script:
      #  use the pipe to authenticate on AWS CodeArtifact
      - pipe: rangel-tadeu/aws-codeartifact-deploy:0.0.1
        variables:
          AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
          AWS_OIDC_ROLE_ARN: "arn:aws:iam::123456789012:role/role_name"
          AWS_CODE_ARTIFACT_DOMAIN: $AWS_CODE_ARTIFACT_DOMAIN
          AWS_CODE_ARTIFACT_DOMAIN_OWNER: $AWS_CODE_ARTIFACT_DOMAIN_OWNER
    artifacts:
      - set_env.sh

- step:
    name: any-other-step
    script:
      - source set_env.sh
      ...

The set_env.sh will set the $CODEARTIFACT_AUTH_TOKEN you need in another step to run your deploy script.

Pipe repository: https://bitbucket.org/rangel-tadeu/aws-codeartifact-deploy/src/master/