AWS Classic

v5.16.0 published on Saturday, Sep 24, 2022 by Pulumi

getFunction

Deprecated:

aws.cloudtrail.getFunction has been deprecated in favor of aws.cloudfront.getFunction

Provides information about a CloudFront Function.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var functionName = config.Require("functionName");
    var existing = Aws.CloudFront.GetFunction.Invoke(new()
    {
        Name = functionName,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/cloudfront"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		functionName := cfg.Require("functionName")
		_, err := cloudfront.LookupFunction(ctx, &cloudfront.LookupFunctionArgs{
			Name: functionName,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudfront.CloudfrontFunctions;
import com.pulumi.aws.cloudfront.inputs.GetFunctionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var config = ctx.config();
        final var functionName = config.get("functionName");
        final var existing = CloudfrontFunctions.getFunction(GetFunctionArgs.builder()
            .name(functionName)
            .build());

    }
}
import pulumi
import pulumi_aws as aws

config = pulumi.Config()
function_name = config.require("functionName")
existing = aws.cloudfront.get_function(name=function_name)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const config = new pulumi.Config();
const functionName = config.require("functionName");
const existing = aws.cloudfront.getFunction({
    name: functionName,
});
configuration:
  functionName:
    type: string
variables:
  existing:
    Fn::Invoke:
      Function: aws:cloudfront:getFunction
      Arguments:
        name: ${functionName}

Using getFunction

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getFunction(args: GetFunctionArgs, opts?: InvokeOptions): Promise<GetFunctionResult>
function getFunctionOutput(args: GetFunctionOutputArgs, opts?: InvokeOptions): Output<GetFunctionResult>
def get_function(name: Optional[str] = None,
                 stage: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetFunctionResult
def get_function_output(name: Optional[pulumi.Input[str]] = None,
                 stage: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetFunctionResult]
func GetFunction(ctx *Context, args *GetFunctionArgs, opts ...InvokeOption) (*GetFunctionResult, error)
func GetFunctionOutput(ctx *Context, args *GetFunctionOutputArgs, opts ...InvokeOption) GetFunctionResultOutput

> Note: This function is named GetFunction in the Go SDK.

public static class GetFunction 
{
    public static Task<GetFunctionResult> InvokeAsync(GetFunctionArgs args, InvokeOptions? opts = null)
    public static Output<GetFunctionResult> Invoke(GetFunctionInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetFunctionResult> getFunction(GetFunctionArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: aws:cloudtrail/getFunction:getFunction
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Name string

Name of the CloudFront function.

Stage string

Function’s stage, either DEVELOPMENT or LIVE.

Name string

Name of the CloudFront function.

Stage string

Function’s stage, either DEVELOPMENT or LIVE.

name String

Name of the CloudFront function.

stage String

Function’s stage, either DEVELOPMENT or LIVE.

name string

Name of the CloudFront function.

stage string

Function’s stage, either DEVELOPMENT or LIVE.

name str

Name of the CloudFront function.

stage str

Function’s stage, either DEVELOPMENT or LIVE.

name String

Name of the CloudFront function.

stage String

Function’s stage, either DEVELOPMENT or LIVE.

getFunction Result

The following output properties are available:

Arn string

ARN identifying your CloudFront Function.

Code string

Source code of the function

Comment string

Comment.

Etag string

ETag hash of the function

Id string

The provider-assigned unique ID for this managed resource.

LastModifiedTime string

When this resource was last modified.

Name string
Runtime string

Identifier of the function's runtime.

Stage string
Status string

Status of the function. Can be UNPUBLISHED, UNASSOCIATED or ASSOCIATED.

Arn string

ARN identifying your CloudFront Function.

Code string

Source code of the function

Comment string

Comment.

Etag string

ETag hash of the function

Id string

The provider-assigned unique ID for this managed resource.

LastModifiedTime string

When this resource was last modified.

Name string
Runtime string

Identifier of the function's runtime.

Stage string
Status string

Status of the function. Can be UNPUBLISHED, UNASSOCIATED or ASSOCIATED.

arn String

ARN identifying your CloudFront Function.

code String

Source code of the function

comment String

Comment.

etag String

ETag hash of the function

id String

The provider-assigned unique ID for this managed resource.

lastModifiedTime String

When this resource was last modified.

name String
runtime String

Identifier of the function's runtime.

stage String
status String

Status of the function. Can be UNPUBLISHED, UNASSOCIATED or ASSOCIATED.

arn string

ARN identifying your CloudFront Function.

code string

Source code of the function

comment string

Comment.

etag string

ETag hash of the function

id string

The provider-assigned unique ID for this managed resource.

lastModifiedTime string

When this resource was last modified.

name string
runtime string

Identifier of the function's runtime.

stage string
status string

Status of the function. Can be UNPUBLISHED, UNASSOCIATED or ASSOCIATED.

arn str

ARN identifying your CloudFront Function.

code str

Source code of the function

comment str

Comment.

etag str

ETag hash of the function

id str

The provider-assigned unique ID for this managed resource.

last_modified_time str

When this resource was last modified.

name str
runtime str

Identifier of the function's runtime.

stage str
status str

Status of the function. Can be UNPUBLISHED, UNASSOCIATED or ASSOCIATED.

arn String

ARN identifying your CloudFront Function.

code String

Source code of the function

comment String

Comment.

etag String

ETag hash of the function

id String

The provider-assigned unique ID for this managed resource.

lastModifiedTime String

When this resource was last modified.

name String
runtime String

Identifier of the function's runtime.

stage String
status String

Status of the function. Can be UNPUBLISHED, UNASSOCIATED or ASSOCIATED.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.