sparse-intern-71089
04/16/2020, 10:24 PMgentle-diamond-70147
04/16/2020, 10:25 PMpulumi.Input<string>
is usually best, but you can also pass the full aws.s3.Bucket
object.
Can you share your code with how you're trying to use the bucket name?faint-motherboard-95438
04/16/2020, 10:33 PMconst cdn = new CDN('website-cdn', {
bucket: myBucket,
}, { provider })
where myBucket
is an aws.s3.Bucket
but I also tried directly myBucket.bucket
with
export interface CdnArgs {
// choose your poison
bucket: string | aws.s3.Bucket | pulumi.Input<string | aws.s3.Bucket>;
}
export class CDN extends pulumi.ComponentResource {
constructor (
name: string,
args: CdnArgs,
opts?: pulumi.ComponentResourceOptions,
) {
super(`${pulumi.getProject()}:CDN`, name, {}, opts)
// use it here
}
}
gentle-diamond-70147
04/16/2020, 10:34 PMfaint-motherboard-95438
04/16/2020, 10:38 PMgentle-diamond-70147
04/16/2020, 10:38 PMgentle-diamond-70147
04/16/2020, 10:39 PMfaint-motherboard-95438
04/16/2020, 10:39 PMfaint-motherboard-95438
04/16/2020, 10:40 PMgentle-diamond-70147
04/16/2020, 10:42 PM.apply()
or .interpolate
to use the value.gentle-diamond-70147
04/16/2020, 10:42 PMcontent: pulumi.interpolate`My bucket is named ${args.bucketName}`,
faint-motherboard-95438
04/16/2020, 10:43 PMgentle-diamond-70147
04/16/2020, 10:43 PMgentle-diamond-70147
04/16/2020, 10:44 PMfaint-motherboard-95438
04/16/2020, 11:07 PMfaint-motherboard-95438
04/16/2020, 11:07 PMfaint-motherboard-95438
04/16/2020, 11:12 PMfaint-motherboard-95438
04/16/2020, 11:14 PMfaint-motherboard-95438
04/16/2020, 11:33 PMbucket: pulumi.Input<aws.s3.Bucket>;
const bucketName = bucket.bucket
does not work, and const bucketName = pulumi.output(args.bucket).apply(b => b.bucket)
does not work either.gentle-diamond-70147
04/16/2020, 11:34 PMgentle-diamond-70147
04/16/2020, 11:36 PMaws.s3.Bucket
object in without the Input wrapper.gentle-diamond-70147
04/16/2020, 11:37 PMaws.s3.Bucket
as the argument...faint-motherboard-95438
04/16/2020, 11:41 PMgentle-diamond-70147
04/16/2020, 11:42 PM