Skip to content

Remove AWS_ACCESS_KEY, AWS_SECRET_KEY environment variable #196

@moreal

Description

@moreal
  • Test IAM Role in EC2 instance with docker compose. (Testing)
  • Remove AWS_ACCESS_KEY, AWS_SECRET_KEY environment variables. (Coding)
  • Deploy.

Test IAM Role in EC2 instance with docker compose

  1. Make policy
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": "kms:Sign",
            "Resource": "arn:aws:kms:us-east-2:<ACCOUNT_ID>:key/<KEY_ID>"
        }
    ]
}
  1. Make IAM Role
  2. Make KMS
  3. Allow IAM Role as KMS user
  4. Make EC2 instance
  5. Bind IAM role to EC2 instance
  6. Run docker-compose up -d
version: '3'
services:
  9c-headless:
    image: ubuntu
    command: sleep 10000
  1. Attach to D
docker run -it <container_ name> /bin/bash
  1. Install awscli
apt update && apt upgrade && apt install -y awscli
  1. Run the command
aws kms --region us-east-2 sign --key-id <KEY_ID> --message aaa --signing-algorithm ECDSA_SHA_256

It doesn't use aws configure so I think they can be removed well.

But the above thing was too simple so I'm not sure the policy's permissions 🤔 I think it should prepare local testing.

Metadata

Metadata

Assignees

Labels

bridgeAn issue or a pull request related to bridge

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions