Ir al contenido

AWS Credentials

Esta página aún no está disponible en tu idioma.

An aws deploy environment in the admin console collects an access key pair. This page says where each value comes from and what shape it has.

FieldEnvironment variableShape
Access key IDAWS_ACCESS_KEY_ID20 uppercase alphanumeric characters, beginning AKIA for a long-lived key or ASIA for a temporary one
Secret access keyAWS_SECRET_ACCESS_KEY40 characters, mixed case with + and /
Session tokenAWS_SESSION_TOKENlong, opaque; only for temporary credentials

The region is not asked for here — the deployer supplies its own default.

  1. Create an IAM user for the deploy, rather than reusing a human’s credentials. In the AWS console go to IAM → Users → Create user, and do not grant it console access.

  2. Attach a policy that covers what your deploy actually does — see Which permissions? below.

  3. Open the user → Security credentials → Create access key, and choose the Application running outside AWS use case.

  4. Copy both halves now. AWS shows the secret access key exactly once; if you lose it you must create a new key, not recover this one.

Or with the CLI:

Terminal window
aws iam create-access-key --user-name greentic-deployer

The response carries AccessKeyId and SecretAccessKey. Nothing prints it again.

If your organisation forbids long-lived keys, assume a role and use the three-part result:

Terminal window
aws sts assume-role \
--role-arn arn:aws:iam::123456789012:role/GreenticDeployer \
--role-session-name greentic

Credentials.AccessKeyId, Credentials.SecretAccessKey and Credentials.SessionToken map onto the three fields. They expire — an hour by default — so a stored deploy credential will stop working and must be refreshed.

Greentic does not publish a minimum IAM policy for an AWS deploy, and this page will not invent one: the AWS deploy lineage in the admin console has been retired, so there is no live pipeline whose calls could be enumerated into a policy that is actually correct.

If you are deploying to AWS through a route that does work for you, derive the policy from that route rather than from a list here — run the deploy with a permissive role first, read CloudTrail for the actions it made, and narrow to those.

The deployer recognises two other credential styles. Neither is offered by the admin console’s environment form, which collects the access key pair only, but both work when you run a deploy yourself with the environment set:

  • Named profile — set AWS_PROFILE (or AWS_DEFAULT_PROFILE) to a profile in ~/.aws/credentials. Nothing secret leaves your machine.
  • Web identity — set AWS_WEB_IDENTITY_TOKEN_FILE to the path of a projected OIDC token, and optionally AWS_ROLE_ARN. This is the shape a CI runner or an EKS pod uses, and it needs no stored secret at all.

Access keys are revoked at the source, not in Greentic:

Terminal window
aws iam update-access-key --user-name greentic-deployer \
--access-key-id AKIA... --status Inactive
aws iam delete-access-key --user-name greentic-deployer --access-key-id AKIA...

Deactivate first and watch for failures before deleting — a key you delete cannot be restored.