import * as core from "@terrascript/core"; export interface FunctionArgs extends core.ResourceArgs { /** * (Required) Source code of the function */ code: string | core.StringOut; /** * (Optional) Comment. */ comment?: string | core.StringOut; /** * (Required) Unique name for your CloudFront Function. */ name: string | core.StringOut; /** * (Optional) Whether to publish creation/change as Live CloudFront Function Version. Defaults to `true * . */ publish?: boolean | core.BooleanOut; /** * (Required) Identifier of the function's runtime. Currently only `cloudfront-js-1.0` is valid. */ runtime: string | core.StringOut; } export class Function extends core.Resource { /** * Amazon Resource Name (ARN) identifying your CloudFront Function. */ @core.attr(String, { computed: true }) public arn!: string | core.StringOut; /** * (Required) Source code of the function */ @core.attr(String) public code!: string | core.StringOut; /** * (Optional) Comment. */ @core.attr(String) public comment?: string | core.StringOut; /** * ETag hash of the function. This is the value for the `DEVELOPMENT` stage of the function. */ @core.attr(String, { computed: true }) public etag!: string | core.StringOut; @core.attr(String, { computed: true }) public id!: string | core.StringOut; /** * ETag hash of any `LIVE` stage of the function. */ @core.attr(String, { computed: true }) public liveStageEtag!: string | core.StringOut; /** * (Required) Unique name for your CloudFront Function. */ @core.attr(String) public name!: string | core.StringOut; /** * (Optional) Whether to publish creation/change as Live CloudFront Function Version. Defaults to `true * . */ @core.attr(Boolean) public publish?: boolean | core.BooleanOut; /** * (Required) Identifier of the function's runtime. Currently only `cloudfront-js-1.0` is valid. */ @core.attr(String) public runtime!: string | core.StringOut; /** * Status of the function. Can be `UNPUBLISHED`, `UNASSOCIATED` or `ASSOCIATED`. */ @core.attr(String, { computed: true }) public status!: string | core.StringOut; constructor(name: string, args?: FunctionArgs) { super(name, "aws_cloudfront_function", args); } public override getNamespace(): string { return "aws_cloudfront"; } }