https://pulumi.com logo
Title
d

dry-keyboard-94795

12/16/2022, 11:51 AM
Is there a way to modify the state directly? I'm unable to perform
stack import
with resources from
google-native
end up with this error:
error: could not deserialize deployment: [400] Message authentication failed
with
--logtostderr -v=9
I1216 11:54:58.164067  119238 sink.go:153] defaultSink::Error(error: could not deserialize deployment: [400] Message authentication failed)
error: could not deserialize deployment: [400] Message authentication failed
m

many-telephone-49025

12/16/2022, 12:23 PM
Hi, Which backend are you using? The Pulumi service?
d

dry-keyboard-94795

12/16/2022, 12:23 PM
yep
m

many-telephone-49025

12/16/2022, 12:24 PM
Did you checked your token or that you logged in?
to the backend?
d

dry-keyboard-94795

12/16/2022, 12:25 PM
the import works fine with the google-native resource omitted
m

many-telephone-49025

12/16/2022, 12:25 PM
the auth agains GCP is fine too?
d

dry-keyboard-94795

12/16/2022, 12:25 PM
yep
This is the
compute.BackendBucket
resource. Was going to change it to using gcp classic, however we need to set a CDN policy, which is blocked by this
m

many-telephone-49025

12/16/2022, 12:27 PM
Just wanted to ask this question
do you may have a snippet to share?
d

dry-keyboard-94795

12/16/2022, 12:33 PM
stripped down version (had to lift from a component):
import pulumi as p
from pulumi_gcp import compute, storage
from pulumi_google_native.compute import beta as compute_beta

bucket = storage.Bucket(
    "bucket",
    location="EU",
    cors=[
        storage.BucketCorArgs(
            methods=["GET"],
            origins=["*"],
        )
    ],
    storage_class="MULTI_REGIONAL",
    uniform_bucket_level_access=True,
)

compute_beta.BackendBucket(
    "backend-bucket",
    bucket_name=bucket.name,
    enable_cdn=True,
    compression_mode=compute_beta.BackendBucketCompressionMode.AUTOMATIC,
    cdn_policy=compute_beta.BackendBucketCdnPolicyArgs(
        cache_mode=compute_beta.BackendBucketCdnPolicyCacheMode.USE_ORIGIN_HEADERS,
    ),
)
Forgot that it's the Beta variant of BackendBucket (compression wasn't GA at the time)
got it importing. BackendBucket seems to export a secret, so needed to unwrap them with
--show-secrets
in the export