boundless-van-74484
03/09/2023, 7:45 PMlifecycleRules
property within aws.s3.Bucket
Hey everyone, I’m trying to create a BucketLifecycleConfiguration
resource for an existing S3 bucket and I’m running into this error when the lifecycle config resource is attempting to create
aws:s3control:BucketLifecycleConfiguration (lifecycle-config):
error: 1 error occurred:
* error parsing S3 Control Bucket ARN (): unknown format
Here’s how I am creating the resources:
const bucket = new aws.s3.Bucket('bucket-name', {
acl: 'private',
corsRules: [
{
allowedHeaders: ['Content-Type', 'Content-Disposition'],
allowedMethods: ['PUT', 'GET', 'HEAD'],
allowedOrigins: [`https://${config.require('webPublicDomain')}`],
exposeHeaders: [
'Content-Type',
'Content-Disposition',
'x-amz-id-2',
'x-amz-request-id',
'x-amz-server-side-encryption',
'ETag',
],
maxAgeSeconds: 3000,
},
],
serverSideEncryptionConfiguration: {
rule: {
applyServerSideEncryptionByDefault: {
sseAlgorithm: 'AES256',
},
},
},
versioning: {
enabled: true,
},
});
new aws.s3.BucketPublicAccessBlock('access-block', {
bucket: bucket.id,
ignorePublicAcls: true,
restrictPublicBuckets: true,
blockPublicAcls: true,
blockPublicPolicy: true,
});
new aws.s3control.BucketLifecycleConfiguration('lifecycle-config', {
bucket: bucket.arn,
rules: [
{
id: 'my-rule',
abortIncompleteMultipartUpload: {
daysAfterInitiation: 2,
},
},
],
});
The only thing I’ve added is the aws.s3control.BucketLifecycleConfiguration
resource. When I run pulumi preview --diff
locally, the correct bucket ARN for the lifecycle config resource is shown and there are no errors. When I run pulumi up --yes
in CI, I get that error.
Both local and CI versions are 3.57.1. Any help is appreciated!dry-journalist-60579
03/09/2023, 8:02 PMlittle-cartoon-10569
03/09/2023, 8:03 PMdry-journalist-60579
03/09/2023, 8:03 PMlittle-cartoon-10569
03/09/2023, 8:03 PMbucket Changes to this property will trigger replacement. string
The name of the source S3 bucket you want Amazon S3 to monitor.
dry-journalist-60579
03/09/2023, 8:04 PM.id
🤷little-cartoon-10569
03/09/2023, 8:04 PMboundless-van-74484
03/09/2023, 8:16 PMpulumi preview
I just discovered the lifecycleRules
property on aws.s3.Bucket… aaand it worked lol. Not sure why there’s all of Bucket.lifecycleRules, BucketLifecycleConfiguration, and BucketLifecycleConfigurationV2