Setup GitHub Codespaces with AWS IAM Roles Anywhere

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • openrolesanywhere

    Open-source proof-of-concept client for AWS IAM Roles Anywhere

    #!/bin/bash set -x set -e # Install openrolesanywhere client if [ -e /tmp/openrolesanywhere ]; then rm -rf /tmp/openrolesanywhere; fi git clone https://github.com/aidansteele/openrolesanywhere.git /tmp/openrolesanywhere cd /tmp/openrolesanywhere/cmd/openrolesanywhere go install . if ([ -z "${ROLES_ANYWHERE_CERTIFICATE}" ] && [ -z "${ROLES_ANYWHERE_ROLE}" ] && [ -z "${SSH_PRIVATE_SIGNING_KEY}" ]); then echo "ROLES_ANYWHERE_CERTIFICATE, ROLES_ANYWHERE_ROLE or SSH_PRIVATE_SIGNING_KEY are undefined - skipping AWS auth setup within Codespaces" else # Setup SSH Signing key mkdir -p ~/.ssh if [ -e ~/.ssh/id_rsa_codespaces ]; then rm -rf ~/.ssh/id_rsa_codespaces; fi printenv 'SSH_PRIVATE_SIGNING_KEY' > ~/.ssh/id_rsa_codespaces chmod 400 ~/.ssh/id_rsa_codespaces ssh-keygen -y -f ~/.ssh/id_rsa_codespaces > ~/.ssh/id_rsa_codespaces.pub # Setup openrolesanywhere config mkdir -p ~/.config/openrolesanywhere printenv 'ROLES_ANYWHERE_CERTIFICATE' > ~/.config/openrolesanywhere/codespaces.pem # Create credential handler for AWS credential_process sudo tee /opt/roles-anywhere-handler << END #!/bin/bash eval "\$(ssh-agent -s)" > /dev/null ssh-add ~/.ssh/id_rsa_codespaces > /dev/null openrolesanywhere credential-process --name codespaces --role-arn $ROLES_ANYWHERE_ROLE END # Setup AWS config mkdir -p ~/.aws tee ~/.aws/config << END [profile default] credential_process = /opt/roles-anywhere-handler region = us-east-1 END fi

  • vscode-dev-containers

    Discontinued NOTE: Most of the contents of this repository have been migrated to the new devcontainers GitHub org (https://github.com/devcontainers). See https://github.com/devcontainers/template-starter and https://github.com/devcontainers/feature-starter for information on creating your own!

    // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: // https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/ubuntu { "name": "Ubuntu", "build": { "dockerfile": "Dockerfile", "args": { "VARIANT": "ubuntu-22.04" } }, "postStartCommand": ".devcontainer/env.sh", "remoteUser": "vscode", "features": { "git": "os-provided", "aws-cli": "latest", "golang": "latest", "sshd": "latest" } }

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

  • Start by deploying a KMS key that will be used as the private key for our certificate authority. An example KMS key can be deployed through the kms.yml template by running the following:

  • Puts Debuggerer

    Ruby library for improved puts debugging, automatically displaying bonus useful information such as source line number and source code.

    #!/bin/bash set -x set -e # Install openrolesanywhere client if [ -e /tmp/openrolesanywhere ]; then rm -rf /tmp/openrolesanywhere; fi git clone https://github.com/aidansteele/openrolesanywhere.git /tmp/openrolesanywhere cd /tmp/openrolesanywhere/cmd/openrolesanywhere go install . if ([ -z "${ROLES_ANYWHERE_CERTIFICATE}" ] && [ -z "${ROLES_ANYWHERE_ROLE}" ] && [ -z "${SSH_PRIVATE_SIGNING_KEY}" ]); then echo "ROLES_ANYWHERE_CERTIFICATE, ROLES_ANYWHERE_ROLE or SSH_PRIVATE_SIGNING_KEY are undefined - skipping AWS auth setup within Codespaces" else # Setup SSH Signing key mkdir -p ~/.ssh if [ -e ~/.ssh/id_rsa_codespaces ]; then rm -rf ~/.ssh/id_rsa_codespaces; fi printenv 'SSH_PRIVATE_SIGNING_KEY' > ~/.ssh/id_rsa_codespaces chmod 400 ~/.ssh/id_rsa_codespaces ssh-keygen -y -f ~/.ssh/id_rsa_codespaces > ~/.ssh/id_rsa_codespaces.pub # Setup openrolesanywhere config mkdir -p ~/.config/openrolesanywhere printenv 'ROLES_ANYWHERE_CERTIFICATE' > ~/.config/openrolesanywhere/codespaces.pem # Create credential handler for AWS credential_process sudo tee /opt/roles-anywhere-handler << END #!/bin/bash eval "\$(ssh-agent -s)" > /dev/null ssh-add ~/.ssh/id_rsa_codespaces > /dev/null openrolesanywhere credential-process --name codespaces --role-arn $ROLES_ANYWHERE_ROLE END # Setup AWS config mkdir -p ~/.aws tee ~/.aws/config << END [profile default] credential_process = /opt/roles-anywhere-handler region = us-east-1 END fi

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts