bright-crayon-39468
03/22/2024, 3:45 AMechoing-dinner-19531
03/23/2024, 8:39 AMadventurous-butcher-54166
03/29/2024, 10:51 PMpulumi.runtime.sync_await._sync_await
as outlined in a comment to #12172adventurous-butcher-54166
03/29/2024, 10:53 PMbright-crayon-39468
03/30/2024, 11:24 PMrhythmic-branch-12845
04/09/2024, 9:27 AMapply
:
_route53 = pulumi.StackReference(...)
domain_name = _route53.get_output('zone').name.apply(lambda v: f'{ v }')
Nope!
pulumi.Output.format('{ 0 }', _route53.get_output('zone').name)
Nope!
pulumi.Output.format('{ 0 }', _route53.get_output('zone').name.apply(lambda v: f'{v}'))
echoing-dinner-19531
04/09/2024, 9:32 AMrhythmic-branch-12845
04/09/2024, 9:32 AMrhythmic-branch-12845
04/09/2024, 9:34 AMdomain_name
in an aws.acm.Certificate resource... but keep getting this:
aws:acm:Certificate (admin.Calling __str__ on an Output[T] is not supported.
To get the value of an Output[T] as an Output[str] consider:
1. o.apply(lambda v: f"prefix{v}suffix")
See <https://www.pulumi.com/docs/concepts/inputs-outputs> for more details.
This function may throw in a future version of Pulumi.):
error: aws:acm/certificate:Certificate resource 'admin.Calling __str__ on an Output[T] is not supported.
To get the value of an Output[T] as an Output[str] consider:
1. o.apply(lambda v: f"prefix{v}suffix")
See <https://www.pulumi.com/docs/concepts/inputs-outputs> for more details.
This function may throw in a future version of Pulumi.' has a problem: invalid value for domain_name (cannot end with a period). Examine values at 'Certificate.DomainName'.
rhythmic-branch-12845
04/09/2024, 9:34 AMcommon_name = f"{ cert['subdomain'] }.{ vars.domain_name }"
cert = aws.acm.Certificate(common_name,
domain_name = common_name,
validation_method = 'DNS',
)
echoing-dinner-19531
04/09/2024, 9:35 AMrhythmic-branch-12845
04/09/2024, 9:37 AMTo get the value of an Output[T] as an Output[str] consider:
1. o.apply(lambda v: f"prefix{v}suffix")
?rhythmic-branch-12845
04/09/2024, 9:37 AMechoing-dinner-19531
04/09/2024, 9:38 AMpulumi*.*Output*.*format
as described in https://www.pulumi.com/docs/concepts/inputs-outputs/all/#using-string-interpolationrhythmic-branch-12845
04/09/2024, 9:39 AM.name
, and .id
echoing-dinner-19531
04/09/2024, 9:40 AM_sync_await
trick listed by @adventurous-butcher-54166 above, or put the code that needs to use the name and id inside an apply
functionrhythmic-branch-12845
04/09/2024, 9:45 AMdomain_name = _sync_await(_route53.get_output_details('zone')).value.name
echoing-dinner-19531
04/09/2024, 9:47 AMrhythmic-branch-12845
04/09/2024, 9:47 AMdomain_name = _sync_await(_route53.get_output_details('zone')).value.name
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'name'
echoing-dinner-19531
04/09/2024, 9:48 AM["name"]
rhythmic-branch-12845
04/09/2024, 9:49 AMrhythmic-branch-12845
04/09/2024, 9:58 AM.apply
call, as if that's what you need to get the value.
In truth (correct me if I'm wrong, pls), the simple assignment only works if what you're assigning becomes an input to a resource. Otherwise, you really need to do everything (why...) in .apply
or .all
lambdas.echoing-dinner-19531
04/09/2024, 10:00 AMrhythmic-branch-12845
04/09/2024, 10:00 AMechoing-dinner-19531
04/09/2024, 10:04 AMrhythmic-branch-12845
04/09/2024, 10:05 AMadventurous-butcher-54166
04/09/2024, 10:24 AMpulumi.Output.concat()
which is useful for concatenating multiple outputs, even with raw strings...rhythmic-branch-12845
04/09/2024, 10:25 AMrhythmic-branch-12845
04/11/2024, 5:36 AMaws.acm.Certificate
, with a resource name based on an output from another stack (my route53
stack) because I would like to have the name of the domain be part of the resource name. It doesn't look like this is ok:
_route53 = pulumi.StackReference('some/ref/stack')
domain_name = _route53.get_output('zone')['name'] # '`.name` instead gives me `AttributeError: 'dict' object has no attribute 'name'`
common_name = domain_name.apply(lambda v: f"{ subdomain }.{ v }")
cert = aws.acm.Certificate(common_name,
domain_name = common_name,
...
)
I get
error: Program failed with an unhandled exception:
Traceback (most recent call last):
File "/Users/jf/../acm/__main__.py", line 10, in <module>
cert = aws.acm.Certificate(common_name,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
TypeError: Expected resource name to be a string
Perhaps only the resource name has an issue being passed an output... but this needs to be noted down somewhere.echoing-dinner-19531
04/11/2024, 7:13 AMrhythmic-branch-12845
04/11/2024, 7:14 AMrhythmic-branch-12845
04/13/2024, 5:19 PMthe outputs of the referenced stack are available immediately
, why do we still need to await
them?
2. Is there any more documentation on this besides one blog entry showing things in one language that isn't python?echoing-dinner-19531
04/13/2024, 6:41 PMrhythmic-branch-12845
04/16/2024, 2:26 AM