https://pulumi.com logo
Title
b

broad-hairdresser-1495

07/16/2021, 10:37 AM
Hi, is this a bug or a feature for
aws.ec2.get_instance
:
import pulumi_aws as aws
imported_instance = aws.ec2.get_instance(
                                         #instance_id="i-08e44dd991ede45a8",
                                         filters=[{'Name': 'tag:Name', 'Values': ["my_ec2_instanceName"]}])
print("::::::::instance_id")
print(imported_instance.instance_id)
print("::::::::id")
print(imported_instance.id)
Please note that results differ:
::::::::instance_id
None  //getting None when not using 'instance_id="i-08e44dd991ede45a8"
::::::::id
i-08e44dd991ede45a8
and when using
instance_id="i-08e44dd991ede45a8"
Results are:
::::::::instance_id
i-08e44dd991ede45a8  //getting 'i-08e44dd991ede45a8' when using 'instance_id="i-08e44dd991ede45a8"
::::::::id
i-08e44dd991ede45a8
b

billowy-army-68599

07/16/2021, 5:38 PM
sorry it's not clear what's happening here, can you elaborate what the differences are?