Coder Social home page Coder Social logo

gcp-sa-to-aws-iam-role's Introduction

GCP Service Account to AWS IAM Role

This repo contains code that accompanies the blog post on using GCP Service Accounts to acquire AWS IAM Role credentials.

Preparation

  1. Create the GCP Service Account
  2. Get the Service Account numeric Client ID

Creating the stack

  1. Acquire AWS credentials with rights to manage IAM Identity Providers, Lambda functions, and IAM Roles.

  2. Build the rendered template and create the stack:

    CLIENT_ID=<service-account-client-id> make deploy
  3. Copy the ARN of the role from the Outputs of the stack

Acquiring Credentials

  1. Create an Ubuntu VM in GCP, and associate the Service Account you created above with it

  2. Log in to that VM

  3. Install pre-requisites:

    apt-get update && apt-get install -y python3-pip
  4. Download this repo onto that system:

    curl -L -o gcp-to-aws.zip https://github.com/cevoaustralia/gcp-sa-to-aws-iam-role/archive/master.zip
  5. Unpack the repo:

    unzip gcp-to-aws.zip
  6. Install the dependencies:

    cd gcp-sa-to-aws-iam-role-master/gcp
    pip3 install -r requirements.txt
  7. Run the script with the ARN of the IAM Role created by the stack (above) as the argument:

    ./get_aws_creds.py arn:aws:iam::123456789012:role/DeploymentRole
  8. Validate that your VM now has AWS credentials:

    aws sts get-caller-identity
  9. Profit!

gcp-sa-to-aws-iam-role's People

Contributors

ap0ught avatar nonspecialist avatar stevemac007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gcp-sa-to-aws-iam-role's Issues

Unable to authenticate with sts:AssumeRoleWithWebIdentity

Hay Team,

After follwoing all the steps mentioned in this docx, unable to create the stack and getting stuck at "DeploymentRole" creation.
After 20-30 minutes stack is getting roll back.

Python version also outdated, however manually changed and tried to create the stack.

Please help with fixing the issue!!!!

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.