https://pulumi.com logo
#general
Title
# general
g

great-spring-37193

08/01/2023, 7:45 PM
#general I am new to pulumi. Trying to combine pulumi and boto3 for my use case but getting below error
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter BucketArn, value: Calling __str__ on an Output[T] is not supported
Here is the code snippet:
Copy code
import pulumi
import pulumi_aws as aws
import boto3

# Create an AWS S3 Bucket using Pulumi
bucket = aws.s3.Bucket("my-bucket")

# Obtain the ARN of the S3 Bucket from the Pulumi resource
bucket_arn = bucket.arn

# Use Boto3 with the ARN
s3_client = boto3.client("s3")
response = s3_client.list_objects_v2(Bucket=bucket_arn)

# Process the response from Boto3 as needed
for obj in response.get("Contents", []):
    print(obj["Key"])
f

fast-vr-6049

08/01/2023, 8:11 PM
Working with Outputs and Strings is going to be one of the most important skills for you to learn while learning Pulumi. Be sure to read this doc page carefully! https://www.pulumi.com/docs/concepts/inputs-outputs/#outputs-and-strings
2 Views