gorgeous-waitress-60098
06/02/2021, 8:23 PMpulumi.Input
types?
I'm using typescript but am curious about Go, too. It looks like Go has a converter https://github.com/jaxxstorm/runmydamncontainer/blob/64064f31565fb96157387202a854a4af1ffdf083/provider/pkg/provider/provider.go#L65
Option A - flat with pulumi types:
export interface StaticPageArgs {
indexContent: pulumi.Input<string>;
}
Or can there be more complex inputs that use standard language (eg. typescript) types or previously defined types?
For example, if I wanted to create a cloudfront distribution where the user can access ~ most ~ of the ordinary Cloudfront config arguments, would something like this work?
Option B:
import { DistributionArgs } from '@pulumi/aws/cloudfront';
export interface StaticPageArgs {
indexContent: pulumi.Input<string>;
someRandomHardcodedConfigValue: number;
// cloudfront distribution args would be available at `args.cloudfront`
cloudfront: DistributionArgs;
}
Option B reeemixx:
import { DistributionArgs } from '@pulumi/aws/cloudfront';
export interface StaticPageArgs extends DistributionArgs{
indexContent: pulumi.Input<string>;
//Cloudfront Distribution args would be available here at the root of args
}
Option C:
import { DistributionArgs } from '@pulumi/aws/cloudfront';
export interface StaticPageArgs extends DistributionArgs{
indexContent: pulumi.Input<string>;
// only provide the user with very limited sets of options because pulumi wants to provide heavily
// opinionated "best practice" components
cloudfrontName: pulumi.Input<string>;
}
billowy-army-68599
06/02/2021, 8:24 PMgorgeous-waitress-60098
06/02/2021, 8:32 PM<<http://pulumi.as>|pulumi.Input<string>
as> well as other nested types (eg. Pulumi.Input<inputs.cloudfront.DistributionDefaultCacheBehavior>
where inputs.cloudfront.DistributionCacheBehavior is defined in the ./types/input
file: https://raw.githubusercontent.com/pulumi/pulumi-aws/master/sdk/nodejs/types/input.ts
[1] https://github.com/pulumi/pulumi-aws/blob/master/sdk/nodejs/cloudfront/distribution.tsschema.json
, just like the "bucket" type is provided here: https://github.com/pulumi/pulumi-component-provider-ts-boilerplate/blob/048f04a8c021e951eeac47b193a1ae819343c4e7/schema.json#L17/aws/v4.0.0/schema.json#/resources/aws:s3%2Fbucket:Bucket
for cloudfront.Distributionbillowy-army-68599
06/02/2021, 10:12 PMflaky-ghost-73674
06/02/2021, 10:12 PM:
in front (e.g. :Distribution
)