rough-pencil-74127
01/19/2024, 10:57 AMpulumi import aws:route53/zone:Zone example.xyz Z0243U76JHV73LKJH98TRS90
and I got this code
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := route53.NewZone(ctx, "lis-dev.xyz", &route53.ZoneArgs{
Comment: pulumi.String("HostedZone created by Route53 Registrar"),
Name: pulumi.String("example.xyz"),
}, pulumi.Protect(true))
if err != nil {
return err
}
return nil
})
}
I used it in my code, but when I want to deploy it (pulumi up
) I get this error
error: Preview failed: resource "urn:pulumi:xxx::yyy::aws:route53/zone:Zone::example.xyz" cannot be deleted
because it is protected. To unprotect the resource, either remove the `protect` flag from the resource in your Pulumi program and run `pulumi up`, or use the command:
`pulumi state unprotect 'urn:pulumi:xxx::yyy::aws:route53/zone:Zone::example.xyz'
So, I don't know if I have to delete the hosted zone, but it would mean that all the records will be lost. Anyone can help me ?great-zebra-31498
01/19/2024, 1:43 PMpulumi up
would want to update some attributes during next run.
I'd suggest to unprotect imported resources and check changes with pulumi preview --diff
first, before running pulumi up
Later, when your infrastructure is stable and there are no changes in preview I'd consider protecting crucial resources.great-zebra-31498
01/19/2024, 1:46 PM--protect=false
flag