These changes support arbitrary combinations of input + plain types within a schema. Handling plain types at the property level was not sufficient to support such combinations. Reifying these types required updating quite a bit of code. This is likely to have caused some temporary complications, but should eventually lead to substantial simplification in the SDK and program code generators. With the new design, input and optional types are explicit in the schema type system. Optionals will only appear at the outermost level of a type (i.e. Input<Optional<>>, Array<Optional<>>, etc. will not occur). In addition to explicit input types, each object type now has a "plain" shape and an "input" shape. The former uses only plain types; the latter uses input shapes wherever a plain type is not specified. Plain types are indicated in the schema by setting the "plain" property of a type spec to true.
8 lines
308 B
TypeScript
8 lines
308 B
TypeScript
import * as pulumi from "@pulumi/pulumi";
|
|
import * as aws from "@pulumi/aws";
|
|
|
|
const logs = new aws.s3.Bucket("logs", {});
|
|
const bucket = new aws.s3.Bucket("bucket", {loggings: [{
|
|
targetBucket: logs.bucket,
|
|
}]});
|
|
export const targetBucket = bucket.loggings.apply(loggings => loggings?[0]?.targetBucket);
|