Package com.pulumi.aws.cloudfront
Class Function
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.cloudfront.Function
-
public class Function extends com.pulumi.resources.CustomResourceProvides a CloudFront Function resource. With CloudFront Functions in Amazon CloudFront, you can write lightweight functions in JavaScript for high-scale, latency-sensitive CDN customizations. See [CloudFront Functions](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cloudfront-functions.html) > **NOTE:** You cannot delete a function if it’s associated with a cache behavior. First, update your distributions to remove the function association from all cache behaviors, then delete the function. ## Example Usage ## Import Using `pulumi import`, import CloudFront Functions using the `name`. For example: ```sh $ pulumi import aws:cloudfront/function:Function test my_test_function ```
-
-
Constructor Summary
Constructors Constructor Description Function(java.lang.String name)Function(java.lang.String name, FunctionArgs args)Function(java.lang.String name, FunctionArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>arn()com.pulumi.core.Output<java.lang.String>code()com.pulumi.core.Output<java.util.Optional<java.lang.String>>comment()com.pulumi.core.Output<java.lang.String>etag()static Functionget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, FunctionState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>>keyValueStoreAssociations()com.pulumi.core.Output<java.lang.String>liveStageEtag()com.pulumi.core.Output<java.lang.String>name()com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>publish()com.pulumi.core.Output<java.lang.String>runtime()com.pulumi.core.Output<java.lang.String>status()com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>>tags()com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>>tagsAll()
-
-
-
Constructor Detail
-
Function
public Function(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
Function
public Function(java.lang.String name, FunctionArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
Function
public Function(java.lang.String name, FunctionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
arn
public com.pulumi.core.Output<java.lang.String> arn()
- Returns:
- ARN identifying your CloudFront Function.
-
code
public com.pulumi.core.Output<java.lang.String> code()
- Returns:
- Source code of the function. Must be between 1 and 40960 bytes.
-
comment
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> comment()
- Returns:
- Comment. Must not exceed 128 characters.
-
etag
public com.pulumi.core.Output<java.lang.String> etag()
- Returns:
- ETag hash of the function. This is the value for the `DEVELOPMENT` stage of the function.
-
keyValueStoreAssociations
public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> keyValueStoreAssociations()
- Returns:
- List of `aws.cloudfront.KeyValueStore` ARNs to be associated to the function. AWS limits associations to one key value store per function.
-
liveStageEtag
public com.pulumi.core.Output<java.lang.String> liveStageEtag()
- Returns:
- ETag hash of any `LIVE` stage of the function.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- Unique name for your CloudFront Function. Valid names contain only alphanumeric characters, hyphens, and underscores, and must be between 1 and 64 characters.
-
publish
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> publish()
- Returns:
- Whether to publish creation/change as Live CloudFront Function Version. Defaults to `true`.
-
runtime
public com.pulumi.core.Output<java.lang.String> runtime()
- Returns:
- Identifier of the function's runtime. Valid values are `cloudfront-js-1.0` and `cloudfront-js-2.0`. The following arguments are optional:
-
status
public com.pulumi.core.Output<java.lang.String> status()
- Returns:
- Status of the function. Can be `UNPUBLISHED`, `UNASSOCIATED` or `ASSOCIATED`.
-
tags
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>> tags()
- Returns:
- Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
-
tagsAll
public com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>> tagsAll()
- Returns:
- Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
-
get
public static Function get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable FunctionState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-