limited-continent-1382
09/16/2022, 9:19 AMpulumi.export("ip", "0.0.0.0")
, but is there a way to get that exported value from that key using Python?millions-furniture-75402
09/16/2022, 1:29 PMlimited-continent-1382
09/16/2022, 1:32 PMmillions-furniture-75402
09/16/2022, 1:34 PMlimited-continent-1382
09/16/2022, 1:43 PMstocky-restaurant-98004
09/17/2022, 9:53 PMlimited-continent-1382
09/19/2022, 6:40 AMstocky-restaurant-98004
09/19/2022, 12:43 PMlimited-continent-1382
09/19/2022, 1:00 PMstocky-restaurant-98004
09/19/2022, 1:01 PMpulumi.export
is for a stack output, which you'd either consume from the command line outside of Pulumi, or in another stack via a StackReference.limited-continent-1382
09/19/2022, 1:08 PMstocky-restaurant-98004
09/19/2022, 1:13 PMweb_bucket = s3.Bucket('s3-website-bucket',
website=s3.BucketWebsiteArgs(
index_document="index.html",
))
content_dir = "www"
for file in os.listdir(content_dir):
filepath = os.path.join(content_dir, file)
mime_type, _ = mimetypes.guess_type(filepath)
obj = s3.BucketObject(file,
bucket=web_bucket.id,
source=FileAsset(filepath),
content_type=mime_type)
web_bucket.id
is an Output of aws.s3.Bucket
. It becomes the input of aws.S3.BucketObject
. This happens automatically. Pulumi figured out what needs to be created in what order.limited-continent-1382
09/19/2022, 1:13 PMstocky-restaurant-98004
09/19/2022, 1:13 PMpulumi up
to completion, and run it again, it will not create anything new because it knows things are already in the state you declared.limited-continent-1382
09/19/2022, 1:20 PMstocky-restaurant-98004
09/19/2022, 1:21 PMlimited-continent-1382
09/19/2022, 6:02 PMstocky-restaurant-98004
09/19/2022, 6:12 PMlimited-continent-1382
09/19/2022, 6:41 PMresource_id = subprocess.run(['pulumi', 'stack', 'output', f'{exported_key_name}'], stdout=subprocess.PIPE).stdout.decode('utf-8').strip()
millions-furniture-75402
09/19/2022, 6:44 PMlimited-continent-1382
09/19/2022, 6:47 PMmillions-furniture-75402
09/19/2022, 6:48 PMlimited-continent-1382
09/19/2022, 6:49 PM