Any ideas on this: <https://stackoverflow.com/ques...
# general
b
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:
Copy code
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:
Copy code
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
let me try it
I think it must be a lambda using Python
Copy code
TypeError: 'Output' object is not callable
seams like there is an issue with Python
b
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
it was closed
b
It was closed after a PR was merged
f
ah yea
Copy code
json = bucket.arn.apply(lambda arn: json.dumps(
        {
            "Version": "2012-10-17",
            "Statement": [
                {
                    "Effect": "Allow",
                    "Action": [
                        "s3:*"
                    ],
                    "Resource": [
                        arn,
                    ]
                }
            ]
        }
    ))
here it is
b
so that looks fine, where are you seeing Output not callable
f
In the TTY
this part:
Copy code
"Resource": [
                        arn,
                    ]
is causing it
b
what is the type of
bucket.arn
outside the lambda and what is the type of
arn
inside the lambda
f
mmt
b
outside it should be
Output<string>
and inside it should just be
string
f
outside: <class 'pulumi.output.Output'>
inside: pulumipulumiStack: (same)
b
he is effectively doing
bucket.id.apply(lambda id: json.dumps(...))
f
k
tnx
something wrong - same issue
b
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
yea, it worked before
Copy code
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
Copy code
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
yea im not sure, i use the dotnet sdk personally
f
k
thanks for your help
I need to debug