sticky-bear-14421
06/20/2023, 9:08 AMDiagnostics:
aws:s3:BucketPolicy (pulumi-infrastructure-bucket-policy):
error: Preview failed: refreshing urn:pulumi:dev::bootstrap::aws:s3/bucketPolicy:BucketPolicy::pulumi-infrastructure-bucket-policy: 1 error occurred:
* reading Amazon S3 (Simple Storage) Bucket Policy (arn:aws:s3:::infrastructure.pulumi.dev): InvalidARNError: invalid ARN
caused by: invalid Amazon s3 ARN, unknown resource type, arn:aws:s3:::infrastructure.pulumi.dev
I created the policy in the policy editor and copied the (real) arn from the s3 console, so everything should be formally correct.
I am working with the latest Pulumi release (3.72.2) with NodeJS Version v18.16.0.
Any ideas why the simple import command fails?new aws.s3.BucketPolicy("pulumi-infrastructure-bucket-policy", {
bucket: bucket.bucket,
policy:
`
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Statement1",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::infrastructure.pulumi.dev",
"arn:aws:s3:::infrastructure.pulumi.dev"
],
"Condition": {
"Bool": {
"aws:SecureTransport": "false"
}
}
}
]
}`,
});
echoing-dinner-19531
06/20/2023, 9:28 AMpulumi import
? Did you get the type token and id the right way round (pulumi import <type> <name> <id/arn>)sticky-bear-14421
06/20/2023, 9:28 AMechoing-dinner-19531
06/20/2023, 9:34 AMsticky-bear-14421
06/20/2023, 9:35 AMpulumi import aws:s3/bucketPolicy:BucketPolicy allow_access_from_another_account my-tf-test-bucket
I guess I was kind of over eager and replaced my-tf-test-bucket with the arnechoing-dinner-19531
06/20/2023, 9:39 AMsticky-bear-14421
06/20/2023, 9:43 AMerror: no name for resource urn:pulumi:dev::bootstrap::aws:s3/bucket:bucket::pulumi-infrastructure-bucket
echoing-dinner-19531
06/20/2023, 9:53 AMsticky-bear-14421
06/20/2023, 10:01 AMpulumi import aws:s3/bucketPolicy:BucketPolicy pulumi-infrastructure-bucket-policy infrastructure.pulumi.dev
echoing-dinner-19531
06/20/2023, 10:04 AMsticky-bear-14421
06/20/2023, 10:06 AM