flat-animal-59128
04/13/2023, 6:54 PMimport pulumi_aws_native as aws_native
The tagging functionality format does not accept the same format I use in the classic api.
for example using
aws_tags = {
'function': cfg.get('function'),
'application': cfg.get('application')}
has worked in the aws classic but this aws_native keeps erroring
ds_s3_resource_bucket = aws_native.s3.Bucket(resource_name= ds_well_comm_base_name
, bucket_name= ds_well_comm_base_name
, access_control = 'Private'
, tags= aws_tags)
keeps erroring
error: aws-native:s3:Bucket resource 'ds-well-comm-base': property tags[0].Key value {<nil>} has a problem: unknown property tags[0].Key
error: aws-native:s3:Bucket resource 'ds-well-comm-base': property tags[0].Value value {<nil>} has a problem: unknown property tags[0].Value
I have tried other formats like a list of jsons. tags=[json.dumps({ 'function': cfg.get('function')}) but get errors like
...problem: tags[0] must be an object
or
...problem: tags must be an array
s3_client = boto3.client('s3')
s3_client.put_bucket_tagging(
Bucket=ds_well_comm_base_name
, Tagging={
'TagSet': [
{
'Key': 'string',
'Value': 'string'
},
]
}
)
billowy-army-68599
04/13/2023, 7:38 PMKey
and Value
the same as boto
aws_tags = [
{ 'Key': function, 'Value': cfg.get('function') }],
flat-animal-59128
04/13/2023, 8:42 PMds_s3_resource_bucket = aws_native.s3.Bucket(resource_name= ds_well_comm_base_name
, bucket_name= ds_well_comm_base_name
, access_control = 'Private'
, tags= [
{
'Key': 'string',
'Value': 'string'
},
]
)
Gives this error
aws-native:s3:Bucket (ds-well-comm-base-dev):
error: aws-native:s3:Bucket resource 'ds-well-comm-base-dev': property tags[0].Key value {<nil>} has a problem: unknown property tags[0].Key
error: aws-native:s3:Bucket resource 'ds-well-comm-base-dev': property tags[0].Value value {<nil>} has a problem: unknown property tags[0].Value
billowy-army-68599
04/13/2023, 8:51 PMflat-animal-59128
04/13/2023, 9:18 PMmy_tags[0].Value
has a value
The error received from pulumi was an unhandled execption
ValueError: unexpected input of type Tag