https://pulumi.com logo
Title
b

bored-oyster-3147

07/06/2021, 4:32 PM
This is a scenario of misunderstanding how
.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;
});
In this case what you want is this:
const 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 want
f

full-island-88669

07/06/2021, 4:38 PM
let me try it
I think it must be a lambda using Python
TypeError: 'Output' object is not callable
seams like there is an issue with Python
b

bored-oyster-3147

07/06/2021, 4:56 PM
That doesn't look like what you are encountering. And that issue you linked was resolved
could help more with a snippet of your
bucket.arn
usage
f

full-island-88669

07/06/2021, 4:58 PM
it was closed
b

bored-oyster-3147

07/06/2021, 4:58 PM
It was closed after a PR was merged
f

full-island-88669

07/06/2021, 4:58 PM
ah yea
json = bucket.arn.apply(lambda arn: json.dumps(
        {
            "Version": "2012-10-17",
            "Statement": [
                {
                    "Effect": "Allow",
                    "Action": [
                        "s3:*"
                    ],
                    "Resource": [
                        arn,
                    ]
                }
            ]
        }
    ))
here it is
b

bored-oyster-3147

07/06/2021, 5:00 PM
so that looks fine, where are you seeing Output not callable
f

full-island-88669

07/06/2021, 5:02 PM
In the TTY
this part:
"Resource": [
                        arn,
                    ]
is causing it
b

bored-oyster-3147

07/06/2021, 5:04 PM
what is the type of
bucket.arn
outside the lambda and what is the type of
arn
inside the lambda
f

full-island-88669

07/06/2021, 5:04 PM
mmt
b

bored-oyster-3147

07/06/2021, 5:05 PM
outside it should be
Output<string>
and inside it should just be
string
f

full-island-88669

07/06/2021, 5:07 PM
outside: <class 'pulumi.output.Output'>
inside: pulumiđŸ˜›ulumi:Stack: (same)
b

bored-oyster-3147

07/06/2021, 5:10 PM
he is effectively doing
bucket.id.apply(lambda id: json.dumps(...))
f

full-island-88669

07/06/2021, 5:10 PM
k
tnx
something wrong - same issue
b

bored-oyster-3147

07/06/2021, 5:17 PM
have you had this pulumi program working before? It sounds like there is a larger issue outside of the snippet that has been shared here
f

full-island-88669

07/06/2021, 5:19 PM
yea, it worked before
extended_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 fine
bucket_arn=bucket.arn,
there is bucket.arn reference
is there a way to bump Python version for venv?
I'm going to try using 3.8
b

bored-oyster-3147

07/06/2021, 5:24 PM
yea im not sure, i use the dotnet sdk personally
f

full-island-88669

07/06/2021, 5:33 PM
k
thanks for your help
I need to debug