boundless-ice-8460
10/31/2024, 12:21 AMDetails: validating provider credentials: retrieving caller identity from STS: operation error STS: GetCallerIdentity, https response error StatusCode: 403, RequestID: e6482c74-b294-4f9d-80c3-2f217408d02c, api error ExpiredToken: The security token included in the request is expired
However, when I run aws sts assume-role to the sub-account role from my management account, it works fine.
Not sure how to debug this farther.little-cartoon-10569
10/31/2024, 12:23 AMboundless-ice-8460
10/31/2024, 12:26 AMlittle-cartoon-10569
10/31/2024, 12:28 AMlittle-cartoon-10569
10/31/2024, 12:29 AMlittle-cartoon-10569
10/31/2024, 12:31 AMboundless-ice-8460
10/31/2024, 12:37 AMboundless-ice-8460
10/31/2024, 12:37 AMlittle-cartoon-10569
10/31/2024, 12:39 AMlittle-cartoon-10569
10/31/2024, 12:41 AMassumeRole
arg, and nothing else. The role is the the one I created via IAM Identity Centre, with the OIDC checks added in thereboundless-ice-8460
10/31/2024, 12:41 AMlittle-cartoon-10569
10/31/2024, 12:41 AMlittle-cartoon-10569
10/31/2024, 12:42 AMlittle-cartoon-10569
10/31/2024, 12:42 AMlittle-cartoon-10569
10/31/2024, 12:43 AMlittle-cartoon-10569
10/31/2024, 12:44 AMboundless-ice-8460
10/31/2024, 12:44 AMboundless-ice-8460
10/31/2024, 12:44 AMpulumi up
it's doing it entirely through the OIDC stuff? Or is that using a local aws profile?little-cartoon-10569
10/31/2024, 12:44 AMlittle-cartoon-10569
10/31/2024, 12:45 AMlittle-cartoon-10569
10/31/2024, 12:45 AMlittle-cartoon-10569
10/31/2024, 12:45 AMlittle-cartoon-10569
10/31/2024, 12:46 AMlittle-cartoon-10569
10/31/2024, 12:47 AMfunction awsOidcIsCurrent(): boolean {
const stdout = execFileSync("aws", ["configure", "list"]).toString("ascii");
const lines = stdout.split(EOL);
const accessKeyLine = lines.find((line) => line.includes("access_key"));
if (accessKeyLine === undefined) {
return false;
}
return accessKeyLine.includes("env");
}
little-cartoon-10569
10/31/2024, 12:48 AMaws configure list
and see if the access_key includes env
little-cartoon-10569
10/31/2024, 1:11 AM$ pulumi env run myproj/myenv aws configure list
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key ****************YJV3 env
secret_key ****************rxeZ env
region <not set> None None
little-cartoon-10569
10/31/2024, 1:11 AMboundless-ice-8460
10/31/2024, 2:02 AMpulumi env run kickplan/oidc-test aws configure list
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key <not set> None None
secret_key <not set> None None
region us-west-2 config-file ~/.aws/config
boundless-ice-8460
10/31/2024, 2:02 AMboundless-ice-8460
10/31/2024, 2:02 AMlittle-cartoon-10569
10/31/2024, 2:03 AMboundless-ice-8460
10/31/2024, 2:10 AMpulumi env run kickplan/oidc-test aws configure list
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key ****************I37Z env
secret_key ****************0OE8 env
region us-west-2 config-file ~/.aws/config
boundless-ice-8460
10/31/2024, 2:10 AMboundless-ice-8460
10/31/2024, 2:10 AMlittle-cartoon-10569
10/31/2024, 2:10 AMboundless-ice-8460
10/31/2024, 2:14 AM// Create an AWS provider
const provider = new aws.Provider("default", {
region: 'us-west-2'
});
How do you instantiate the provider? This always gives me pulumi:providers:aws resource 'default' has a problem: No valid credential sources found.
little-cartoon-10569
10/31/2024, 2:16 AMassumeRole
or assumeRoleWithIdentity
args in the constructor.boundless-ice-8460
10/31/2024, 3:11 AMboundless-ice-8460
10/31/2024, 3:11 AMboundless-ice-8460
10/31/2024, 3:11 AMsparse-caravan-37954
11/04/2024, 4:35 PMvalues:
aws:
login:
fn::open::aws-login:
oidc:
duration: 1h
roleArn: arn:aws:iam::{roleArn}
sessionName: pulumi-environments-session
subjectAttributes:
- currentEnvironment.name
- pulumi.user.login
pulumiConfig:
aws:accessKey: ${aws.login.accessKeyId}
aws:secretKey: ${aws.login.secretAccessKey}
aws:token: ${aws.login.sessionToken}
aws:region: us-east-1
The AWS oidc role's trust relationships:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Federated": "arn:aws:iam::243709619272:oidc-provider/api.pulumi.com/oidc"
},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"<http://api.pulumi.com/oidc:aud|api.pulumi.com/oidc:aud>": "{mypulumiorg}"
}
}
}
]
}
the stack I am trying to update has a very simple yml with just the environment
key
When running pulumi up
or refresh
I get a bunch of
error: Preview failed: 1 error occurred:
* Retrieving AWS account details: validating provider credentials: retrieving caller identity from STS: operation error STS: GetCallerIdentity, https response error StatusCode: 403, RequestID: 0ac7335b-9092-4a96-9a63-a8274e7d47f8, api error ExpiredToken: The security token included in the request is expired
sparse-caravan-37954
11/04/2024, 4:36 PMpulumi env run my/env/path aws configure list
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key <not set> None None
secret_key <not set> None None
region <not set> None None
sparse-caravan-37954
11/04/2024, 4:37 PMsparse-caravan-37954
11/04/2024, 4:40 PMlittle-cartoon-10569
11/04/2024, 6:57 PMpulumi up
does it still happen? If not, that suggests that something is not requesting a new temporary token when the only interactions with the provider are deletes. Which sounds very much like a bug.sparse-caravan-37954
11/04/2024, 7:56 PMpulumi up
does it still happen?"sparse-caravan-37954
11/04/2024, 8:07 PMpulumi up
command in this case creates the resources needed but fail in deleting