numerous-printer-41511
11/06/2021, 10:09 PMterraform import
and pulumi import
don’t generate the associated HCL (in TF) or Go code (in Pulumi). Is there a reason this can’t be done?freezing-van-87649
11/06/2021, 10:38 PMbillowy-army-68599
11/07/2021, 4:36 AMterraform import
, but can you clarify what you mean regarding pulumi import
?pulumi import
and it generated the Go code for me?
pulumi import aws:s3/bucket:Bucket simple-bucket s3-website-bucket-01411d8 <aws:pulumi-dev-sandbox>
Previewing import (dev)
View Live: <https://app.pulumi.com/jaxxstorm/example/dev/previews/50708d81-556f-4bb6-a455-5d3473568e9e>
Type Name Plan
+ pulumi:pulumi:Stack example-dev create
= └─ aws:s3:Bucket simple-bucket import
Resources:
+ 1 to create
= 1 to import
2 changes
Do you want to perform this import? yes
Importing (dev)
View Live: <https://app.pulumi.com/jaxxstorm/example/dev/updates/1>
Type Name Status
+ pulumi:pulumi:Stack example-dev created
= └─ aws:s3:Bucket simple-bucket imported
Resources:
+ 1 created
= 1 imported
2 changes
Duration: 6s
Please copy the following code into your Pulumi application. Not doing so
will cause Pulumi to report that an update will happen on the next update command.
Please note that the imported resources are marked as protected. To destroy them
you will need to remove the `protect` option and run `pulumi update` *before*
the destroy will take effect.
package main
import (
"<http://github.com/pulumi/pulumi-aws/sdk/v4/go/aws/s3|github.com/pulumi/pulumi-aws/sdk/v4/go/aws/s3>"
"<http://github.com/pulumi/pulumi/sdk/v3/go/pulumi|github.com/pulumi/pulumi/sdk/v3/go/pulumi>"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := s3.NewBucket(ctx, "simple_bucket", &s3.BucketArgs{
Acl: pulumi.String("private"),
Bucket: pulumi.String("s3-website-bucket-01411d8"),
ForceDestroy: pulumi.Bool(false),
Website: &s3.BucketWebsiteArgs{
IndexDocument: pulumi.String("index.html"),
},
}, pulumi.Protect(true))
if err != nil {
return err
}
return nil
})
}
numerous-printer-41511
11/07/2021, 4:37 AMbillowy-army-68599
11/07/2021, 4:37 AMPulumi.yaml
numerous-printer-41511
11/07/2021, 4:40 AMpulumi.Import
optionbillowy-army-68599
11/08/2021, 3:09 PMnumerous-printer-41511
11/08/2021, 9:47 PM