AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.4.0 published on Wednesday, May 4, 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 Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var functionName = config.Require("functionName");
        var existing = Output.Create(Aws.CloudFront.GetFunction.InvokeAsync(new Aws.CloudFront.GetFunctionArgs
        {
            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 java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

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

    public static void stack(Context ctx) {
        final var config = Config.of();
        final var functionName = config.get("functionName");
        final var existing = Output.of(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

The function’s stage, either DEVELOPMENT or LIVE.

Name string

Name of the CloudFront function.

Stage string

The function’s stage, either DEVELOPMENT or LIVE.

name String

Name of the CloudFront function.

stage String

The function’s stage, either DEVELOPMENT or LIVE.

name string

Name of the CloudFront function.

stage string

The function’s stage, either DEVELOPMENT or LIVE.

name str

Name of the CloudFront function.

stage str

The function’s stage, either DEVELOPMENT or LIVE.

name String

Name of the CloudFront function.

stage String

The function’s stage, either DEVELOPMENT or LIVE.

getFunction Result

The following output properties are available:

Arn string

Amazon Resource Name (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

Amazon Resource Name (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

Amazon Resource Name (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

Amazon Resource Name (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

Amazon Resource Name (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

Amazon Resource Name (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.