sparse-intern-71089
07/29/2022, 8:52 AMstrong-helmet-83704
07/29/2022, 3:46 PMlittle-cartoon-10569
07/31/2022, 9:51 PMrhythmic-branch-12845
08/01/2022, 3:42 AMDiagnostics:
aws:ec2:Instance (api):
error: unable to validate AWS credentials - see <https://pulumi.io/install/aws.html> for details on configuration
little-cartoon-10569
08/01/2022, 4:45 AMlittle-cartoon-10569
08/01/2022, 4:49 AMrhythmic-branch-12845
08/01/2022, 4:54 AMrhythmic-branch-12845
08/01/2022, 6:37 AMpulumi up
. That’s because these credentials aren’t permanent, and have a timeout
2. leaving number 1 aside, it was working for a while for me… but after changing the permissions of the IAM role (it currently allows for "*", "*"
), I am getting AuthFailure: AWS was not able to validate the provided access credentials
and Pulumi no longer works?rhythmic-branch-12845
08/01/2022, 7:27 AMlittle-cartoon-10569
08/01/2022, 9:09 PMlittle-cartoon-10569
08/01/2022, 9:11 PMlittle-cartoon-10569
08/01/2022, 9:14 PMrhythmic-branch-12845
08/02/2022, 11:17 AMrhythmic-branch-12845
08/02/2022, 11:28 AM[default]
role_arn = arn:aws:iam::<ACCOUNT_ID>:role/pulumi
And then pulumi config set --path aws:assumeRole.roleArn arn:aws:iam::<ACCOUNT_ID>:role/pulumi
.
No luck: error: Preview failed: unable to validate AWS credentials - see <https://pulumi.io/install/aws.html> for details on configuration
little-cartoon-10569
08/02/2022, 8:34 PMrhythmic-branch-12845
08/03/2022, 3:21 AM[pulumi]
role_arn = arn:aws:iam::<ACCOUNT_ID>:role/pulumi
source_profile = default
(no need for ~/.aws/credentials)
Pulumi.dev.yaml:
config:
aws:region: ap-southeast-1
aws:profile: pulumi
With this setup, I still get the dreaded error: Preview failed: unable to validate AWS credentials - see <https://pulumi.io/install/aws.html> for details on configuration
Is my setup correct?rhythmic-branch-12845
08/03/2022, 3:25 AM[pulumi]
role_arn = arn:aws:iam::<ACCOUNT_ID>:role/pulumi
credential_source = Ec2InstanceMetadata
limited-rainbow-51650
08/03/2022, 6:36 AMrhythmic-branch-12845
08/03/2022, 6:38 AMlimited-rainbow-51650
08/03/2022, 6:42 AMrhythmic-branch-12845
08/03/2022, 6:43 AMlimited-rainbow-51650
08/03/2022, 6:44 AMlimited-rainbow-51650
08/03/2022, 6:47 AMpulumi config set aws:skipMetadataApiCheck false
rhythmic-branch-12845
08/03/2022, 6:53 AMconfig:
aws:region: ap-southeast-1
aws:skipMetadataApiCheck: "false"
And I’ve got absolutely nothing in ~/.aws now. And I still get error: Preview failed: unable to validate AWS credentials - see <https://pulumi.io/install/aws.html> for details on configuration
limited-rainbow-51650
08/03/2022, 6:57 AMcurl <http://169.254.169.254/latest/meta-data/identity-credentials/ec2/security-credentials/ec2-instance>
Do you get valid credentials back in the returned JSON document?limited-rainbow-51650
08/03/2022, 7:00 AMcurl
commands you can try: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.htmlrhythmic-branch-12845
08/03/2022, 7:01 AMlimited-rainbow-51650
08/03/2022, 8:10 AMaws ec2 describe-instances --instance-ids <your-instance-id>
rhythmic-branch-12845
08/03/2022, 10:26 AMlimited-rainbow-51650
08/03/2022, 12:30 PMlimited-rainbow-51650
08/03/2022, 1:18 PMlimited-rainbow-51650
08/03/2022, 1:26 PMpulumi config set aws:skipCredentialsValidation true
rhythmic-branch-12845
08/03/2022, 1:42 PMrhythmic-branch-12845
08/03/2022, 1:43 PMrhythmic-branch-12845
08/03/2022, 1:44 PMerror: Preview failed: unable to validate AWS credentials - see <https://pulumi.io/install/aws.html> for details on configuration
If I also set aws:skipMetadataApiCheck
to false, the same error happensrhythmic-branch-12845
08/03/2022, 1:48 PMaws ec2 describe-instances --instance-ids <ID>
limited-rainbow-51650
08/03/2022, 1:54 PMrhythmic-branch-12845
08/03/2022, 1:54 PMconfig:
aws:region: ap-southeast-1
aws:skipCredentialsValidation: "true"
#aws:skipMetadataApiCheck: "false"
limited-rainbow-51650
08/03/2022, 1:55 PMrhythmic-branch-12845
08/03/2022, 2:00 PMlimited-rainbow-51650
08/03/2022, 2:04 PMaws describe-instances
command
• You ran pulumi config set aws:skipCredentialsValidation true
• You ran pulumi config set aws:skipMetadataApiCheck false
• pulumi preview
or pulumi up
always results in unable to validate AWS credentials
Is that correctly summarized?rhythmic-branch-12845
08/03/2022, 2:16 PMpulumi up -r
.
So:
• pulumi refresh
(or pulumi up -r
) gives me error: Preview failed: unable to validate AWS credentials - see <https://pulumi.io/install/aws.html> for details on configuration
• pulumi preview
and pulumi up
(no refresh) gives me a new error:
error: 1 error occurred:
* error configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found.
Please see <https://registry.terraform.io/providers/hashicorp/aws>
for more information about providing credentials.
Error: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, access disabled to EC2 IMDS via client option, or "AWS_EC2_METADATA_DISABLED" environment variable
rhythmic-branch-12845
08/03/2022, 2:19 PMrhythmic-branch-12845
08/03/2022, 2:24 PMpulumi preview
and pulumi up
work?
any sort of “refresh” operation though, pulumi refresh
, or pulumi up -r
still does not work, with the same old error messagerhythmic-branch-12845
08/03/2022, 2:25 PMaws describe-instances
command
• I ran pulumi config set aws:skipCredentialsValidation true
• I ran pulumi config set aws:skipMetadataApiCheck false
• pulumi preview
works
• pulumi up
works - and is even able to apply changes!
• BUT pulumi refresh
and pulumi up -r
always result in error: Preview failed: unable to validate AWS credentials - see <https://pulumi.io/install/aws.html> for details on configuration
limited-rainbow-51650
08/03/2022, 2:37 PMpulumi config set aws:skipGetEc2Platforms false
rhythmic-branch-12845
08/03/2022, 2:38 PMlimited-rainbow-51650
08/03/2022, 2:47 PMskip…
options (see Installation & Configuration) had some of their default values changed to speed up the authentication process for the majority of the cases. The aws:skipMetadataApiCheck
option needs to be set to false
in CI cases where the underlying worker nodes are having an instance profile attached (your case).rhythmic-branch-12845
08/03/2022, 2:50 PMrhythmic-branch-12845
08/03/2022, 2:52 PMPulumi.dev.yaml
just to test the config settings: it looks like I need both pulumi config set aws:skipCredentialsValidation true
and pulumi config set aws:skipMetadataApiCheck false
for things to work:
with only aws:skipMetadataApiCheck: "false"
I get error: unable to validate AWS credentials - see <https://pulumi.io/install/aws.html> for details on configuration
with only aws:skipCredentialsValidation: "true"
I get
error: 1 error occurred:
* error configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found.
Please see <https://registry.terraform.io/providers/hashicorp/aws>
for more information about providing credentials.
Error: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, access disabled to EC2 IMDS via client option, or "AWS_EC2_METADATA_DISABLED" environment variable
I have to say that I was not expecting to have to know stuff at this level and deal with these settings to be able to get things to work (once AWS got cooperative, that is) with an instance profile. But again, thank you.limited-rainbow-51650
08/03/2022, 2:54 PMlimited-rainbow-51650
08/03/2022, 2:56 PM