sparse-intern-71089
07/06/2021, 4:25 PMbored-oyster-3147
07/06/2021, 4:32 PM.apply(...)
functions. You cannot get the string out of an Output<string>
. You can only act on it inside the apply delegate
If you want to do something with Output<string>
than you need to:
output.apply(x => {
// here x is a string and I can now do whatever I want with it
return x;
});
bored-oyster-3147
07/06/2021, 4:33 PMconst json = bucket.arn.apply(arn => json.dumps(
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:*",
],
"Resource": [
arn,
]
}
]
}
)));
And now json
is an Output<string>
representation of the JSON that you wantfull-island-88669
07/06/2021, 4:38 PMfull-island-88669
07/06/2021, 4:41 PMfull-island-88669
07/06/2021, 4:56 PMTypeError: 'Output' object is not callable
full-island-88669
07/06/2021, 4:56 PMfull-island-88669
07/06/2021, 4:56 PMbored-oyster-3147
07/06/2021, 4:56 PMbored-oyster-3147
07/06/2021, 4:58 PMbucket.arn
usagefull-island-88669
07/06/2021, 4:58 PMbored-oyster-3147
07/06/2021, 4:58 PMfull-island-88669
07/06/2021, 4:58 PMfull-island-88669
07/06/2021, 4:59 PMjson = bucket.arn.apply(lambda arn: json.dumps(
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:*"
],
"Resource": [
arn,
]
}
]
}
))
full-island-88669
07/06/2021, 4:59 PMbored-oyster-3147
07/06/2021, 5:00 PMfull-island-88669
07/06/2021, 5:02 PMfull-island-88669
07/06/2021, 5:03 PM"Resource": [
arn,
]
full-island-88669
07/06/2021, 5:03 PMbored-oyster-3147
07/06/2021, 5:04 PMbucket.arn
outside the lambda and what is the type of arn
inside the lambdafull-island-88669
07/06/2021, 5:04 PMbored-oyster-3147
07/06/2021, 5:05 PMOutput<string>
and inside it should just be string
full-island-88669
07/06/2021, 5:07 PMfull-island-88669
07/06/2021, 5:08 PMbored-oyster-3147
07/06/2021, 5:10 PMbored-oyster-3147
07/06/2021, 5:10 PMbucket.id.apply(lambda id: json.dumps(...))
full-island-88669
07/06/2021, 5:10 PMfull-island-88669
07/06/2021, 5:11 PMfull-island-88669
07/06/2021, 5:16 PMbored-oyster-3147
07/06/2021, 5:17 PMfull-island-88669
07/06/2021, 5:19 PMfull-island-88669
07/06/2021, 5:20 PMextended_s3_stream = aws.kinesis.FirehoseDeliveryStream(
f"{stack_name}-delivery-stream",
destination="extended_s3",
extended_s3_configuration=aws.kinesis.FirehoseDeliveryStreamExtendedS3ConfigurationArgs(
role_arn=firehose_s3_role.arn,
bucket_arn=bucket.arn,
compression_format="GZIP",
))
this part works finefull-island-88669
07/06/2021, 5:20 PMbucket_arn=bucket.arn,
full-island-88669
07/06/2021, 5:20 PMfull-island-88669
07/06/2021, 5:22 PMfull-island-88669
07/06/2021, 5:23 PMbored-oyster-3147
07/06/2021, 5:24 PMfull-island-88669
07/06/2021, 5:33 PMfull-island-88669
07/06/2021, 5:33 PMfull-island-88669
07/06/2021, 5:33 PM