creamy-monkey-35142
03/24/2023, 7:53 AMsecret
is required and I didn’t find a way to add secret value during import,secret
have default value is “”. but I want secret
have value to avoid
Modifying this attribute will force creation of a new resource.
echoing-dinner-19531
03/24/2023, 4:58 PMpulumi import
or the import resource option?creamy-monkey-35142
03/25/2023, 3:46 AMpulumi import cloudflare:index/tunnel:Tunnel example <account_id>/<tunnel_id>
and with
pulumi import -f resources.json
where content of resource is
{
"resources": [{
"type": "cloudflare:index/tunnel:Tunnel",
"name": "cf-tunnel-01",
"id": "<account_id>/<tunnel_id>",
"secret": "<secret_base64_value>"
}
}
also tried with python
example = cloudflare.Tunnel("example",
account_id="<account_id>",
name="cf-tunnel-01",
secret="<secret_base64_value>=",
opts=pulumi.ResourceOptions(import_=<tunnel_id>)
warning: cloudflare:index/tunnel:Tunnel resource 'cf-tunnel-01' has a problem: Missing required argument: The argument "secret" is required, but no definition was found.. Examine values at 'Tunnel.Secret'
and it’ll generate code block after select yes with secret = ""
warning: inputs to import do not match the existing resource; importing this resource will fail
select details
in the pulumi up show a green line like
+ secret=[secret]
echoing-dinner-19531
03/25/2023, 8:38 AMRead
method isn't returning all the data for the object, but I expect this is one of the awkward cases where they don't give any read access to this property once set because it's sensitive.
Can you raise an issue at https://github.com/pulumi/pulumi-cloudflare/issues about this, we might be able to come up with some shortterm instructions to manually edit the state to "fix" this, but sounds like longer term we'll either need to somehow get Read
to find the property data or come up with some standard way to import things where we can't know all the property values for them.creamy-monkey-35142
03/25/2023, 9:47 AMechoing-dinner-19531
03/25/2023, 12:26 PMcreamy-monkey-35142
04/05/2023, 8:47 AMsecret
and tunnelToken
directly in state file
"outputs": {
"accountId": "<redacted>",
"cname": "<redacted>.<http://cfargotunnel.com|cfargotunnel.com>",
"id": "<redacted>",
"name": "test-tunnel",
"secret": {
"4dabf181XXX939515e22adb298388d": "1XXX061264138c4ac30d75fd1eb4XXX0",
"ciphertext": "v1:gMPrepTA/bQnmaFD:7XXXXBp0cnH9uPco6hH5SmpijRLnywxUMT9BoT1D0fu8gy+mpR65N1Eymrcn94XXXGEFr+DI="
},
"tunnelToken": {
"4dabf1819307XXX22adb298388d": "1b47061264XXX0d75fd1eb44270",
"ciphertext": "v1:XXXpa/ytRaEtdVt5:wDd+czD4u/ASEXXTX7TE1wNTT+3DidXU71u+/HWhoMDrDsgT8qvAIQQ385DnVPOejiPXurRcKWHBwa4rehoX7snAAD6XXU+V/1fWd/9h9SrBDG0MFGnuXmRJzHQuNGJjbgY5wm3aNIlOlpy0DlqIFb+UNKyjmUVkY2ZC/ubdUXQ9IaiA5qA7KznkGMFt03cl3teXXX10blxUNRSVBuzkG31wTrtw199cQDfNle9MrnQaaUhSPXDvWeRI4W"
}
},
echoing-dinner-19531
04/05/2023, 8:55 AM--show-secrets
for preview/up it'll give you the actual diff for the secret property rather than just + secret=[secret]