UNPKG

@pulumi/aws-native

Version:

The Pulumi AWS Cloud Control Provider enables you to build, deploy, and manage [any AWS resource that's supported by the AWS Cloud Control API](https://github.com/pulumi/pulumi-aws-native/blob/master/provider/cmd/pulumi-gen-aws-native/supported-types.txt)

91 lines (90 loc) 4.94 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Creates a CF function. * To create a function, you provide the function code and some configuration information about the function. The response contains an Amazon Resource Name (ARN) that uniquely identifies the function, and the function’s stage. * By default, when you create a function, it’s in the ``DEVELOPMENT`` stage. In this stage, you can [test the function](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/test-function.html) in the CF console (or with ``TestFunction`` in the CF API). * When you’re ready to use your function with a CF distribution, publish the function to the ``LIVE`` stage. You can do this in the CF console, with ``PublishFunction`` in the CF API, or by updating the ``AWS::CloudFront::Function`` resource with the ``AutoPublish`` property set to ``true``. When the function is published to the ``LIVE`` stage, you can attach it to a distribution’s cache behavior, using the function’s ARN. * To automatically publish the function to the ``LIVE`` stage when it’s created, set the ``AutoPublish`` property to ``true``. */ export declare class Function extends pulumi.CustomResource { /** * Get an existing Function resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, opts?: pulumi.CustomResourceOptions): Function; /** * Returns true if the given object is an instance of Function. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Function; /** * A flag that determines whether to automatically publish the function to the ``LIVE`` stage when it’s created. To automatically publish to the ``LIVE`` stage, set this property to ``true``. */ readonly autoPublish: pulumi.Output<boolean | undefined>; /** * The ARN of the function. For example: * * `arn:aws:cloudfront::123456789012:function/ExampleFunction` . * * To get the function ARN, use the following syntax: * * `!GetAtt *Function_Logical_ID* .FunctionMetadata.FunctionARN` */ readonly functionArn: pulumi.Output<string>; /** * The function code. For more information about writing a CloudFront function, see [Writing function code for CloudFront Functions](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/writing-function-code.html) in the *Amazon CloudFront Developer Guide*. */ readonly functionCode: pulumi.Output<string>; /** * Contains configuration information about a CloudFront function. */ readonly functionConfig: pulumi.Output<outputs.cloudfront.FunctionConfig>; /** * Contains metadata about a CloudFront function. */ readonly functionMetadata: pulumi.Output<outputs.cloudfront.FunctionMetadata | undefined>; /** * A name to identify the function. */ readonly name: pulumi.Output<string>; readonly stage: pulumi.Output<string>; /** * Create a Function resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: FunctionArgs, opts?: pulumi.CustomResourceOptions); } /** * The set of arguments for constructing a Function resource. */ export interface FunctionArgs { /** * A flag that determines whether to automatically publish the function to the ``LIVE`` stage when it’s created. To automatically publish to the ``LIVE`` stage, set this property to ``true``. */ autoPublish?: pulumi.Input<boolean>; /** * The function code. For more information about writing a CloudFront function, see [Writing function code for CloudFront Functions](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/writing-function-code.html) in the *Amazon CloudFront Developer Guide*. */ functionCode: pulumi.Input<string>; /** * Contains configuration information about a CloudFront function. */ functionConfig: pulumi.Input<inputs.cloudfront.FunctionConfigArgs>; /** * Contains metadata about a CloudFront function. */ functionMetadata?: pulumi.Input<inputs.cloudfront.FunctionMetadataArgs>; /** * A name to identify the function. */ name?: pulumi.Input<string>; }