pulumi / pulumi-aws

An Amazon Web Services (AWS) Pulumi resource package, providing multi-language access to AWS
Apache License 2.0
459 stars 155 forks source link

AWS STS errors #2560

Open GustavoGama-DBACheck opened 1 year ago

GustavoGama-DBACheck commented 1 year ago

The AWS setup is a complete issue.

Expected behavior

Once the login is established and successful, the interaction with AWS API must be transparent for the developer. The user does not have temporary session, is a IAM user with access keys.

Current behavior

pulumi login s3://operations-tests-3 Logged in to Gustavos-MacBook-Pro.Home as gustavogama (s3://operations-tests-3) pulumi up Previewing update (dev-core-infra): Type Name Plan Info pulumi:pulumi:Stack core-infra-dev-core-infra 2 errors; 10 messages

Diagnostics: pulumi:pulumi:Stack (core-infra-dev-core-infra): Error: invocation of aws:index/getAvailabilityZones:getAvailabilityZones returned an error: 1 error occurred:

Steps to reproduce

  1. Create AWS
  2. Create USER cicd with AdministratorAccess
  3. Add user credentyials to .aws config and credentials files
  4. Login into AWS or define env variables
  5. Create BUCKET
  6. pulumi login s3://
  7. pulumi new with aws-python (make the region the same of the bucket)
  8. c change main to use awsx to create a vpc
  9. pulumi up -> and the result is in previous section
  10. The issue is the sts:GetCallerIdentity

Context (Environment)

aws sts get-caller-identity --query "Account" --output text 882205788219

{ "UserId": "AIDA42Z4QBA533JXXXXX", "Account": "88220578XXXX", "Arn": "arn:aws:iam::88220578XXXX:user/cicd-user" } (END)

env virables: AWS_ACCESS_KEY_ID=XXXXXXX4QBA56JJXXXXX AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXJh4WbJ/ZIOTirOh4spYzpdXXXXX AWS_PROFILE=cicd-user AWS_REGION=eu-west-1

Affected feature

deploy infra into AWS

danielrbradley commented 1 year ago

Hi @GustavoGama-DBACheck sorry you've been having some challenges getting the AWS authentication configured.

The error message seems quite certain that the provider is finding an existing session token which it's using. This could perhaps be due to having AWS_SESSION_TOKEN set in your environment, in your AWS or Pulumi config, or set explicitly in your program.

Other than following the installation guide it's not obvious what other factors might be causing this behaviour. Perhaps another approach you could try is to set this up on a clean machine installation - perhaps via a docker container to see if there's something in your ambient environment causing the issue.

t0yv0 commented 2 weeks ago

Closing as stale - unfortunately our team cannot make progress on this one without a repro. Please reopen with a repro if you are still hitting a problem.