sparse-intern-71089
07/23/2021, 11:26 AMbroad-hairdresser-1495
07/23/2021, 11:35 AMpulumi_aws as aws
aws.ec2.get_instance(filters=filterForImport)
all tags are skipped with aws:
key names.
This is a printout when running pulumi up
and using same filter with 2 different instance get by filter:
:::::::::::TAGS__from:
import pulumi_aws as aws
aws.ec2.get_instance(filters=filterForImport)
{'Name': 'aws-cloud9-eric-testing-machine-d8c776e86c1447ef82fe0aa544ec....'}
:::::::::::TAGS__from:
import boto3
boto3.resource('ec2').instances.filter(Filters=filterForImport)
{'Name': 'aws-cloud9-eric-testing-machine-d8c776e86c1447ef82fe0aa544ec....',
'aws:cloudformation:logical-id': 'Instance',
'aws:cloudformation:stack-name': 'aws-cloud9-eric-testing-machine-d8c776e86c1447ef82fe0aa544ec....',
'aws:cloud9:environment': 'd8c776e86c1447ef82....',
'aws:cloud9:owner': 'AIDA26ARS26....',
'aws:cloudformation:stack-id': 'arn:aws:cloudformation:eu-west-1:7516561....:stack/aws-cloud9-eric-testing-machine-d8c776e86c1447ef82fe0aa544ec..../d9f79450-6813-11ea-9d48-0....
'aws:cloudformation:stack-id': 'arn:aws:cloudformation:eu-west-1:7516561....:stack/aws-cloud9-eric-testing-machine-d8c776e86c1447ef82fe0aa544ec..../d9f79450-6813-11ea-9d48-0a9bdcf....
a'}
When using aws.ec2.get_instance(filters=filterForImport)
function skips all data with aws:
great-sunset-355
07/23/2021, 11:51 AMgreat-sunset-355
07/23/2021, 11:55 AMaws:
are reserved for AWS managed resources, are you trying to import aws managed resource to manage it or just for the reference?
If you want to manage cloud9 instances I think you'll have to use cloud9
package and not trying to manage the instance directly.
This "bug" sounds to me like a protection from the sdk when you are trying to manage AWS managed resource and potentially cause some problems.
With cloud9 ec2 instance it's similar when you'd want to manage ec2 instance of RDS and therefore break AWS servicebroad-hairdresser-1495
07/23/2021, 12:10 PMaws:
in. And later you will have a diff that Pulumi wants to create these tags...
But what have Pulumi against what you as an end user create in any resource, that you cant use this:
"tags": {
"aws:a_bug": "not creating or importing when tag Key starts with 'aws:'"
}
so its definitely a bug.great-sunset-355
07/23/2021, 2:43 PMaws:
tags are system reserved tags and you should never need to import or create resources with such tags.
https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html
The requirement to import AWS-managed resources to your code suggests an antipattern in your workflow.
As a user, you should never need to change properties of managed resource