1. Packages
  2. AWS Classic
  3. API Docs
  4. iot
  5. Authorizer

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.3.0 published on Thursday, Sep 28, 2023 by Pulumi

aws.iot.Authorizer

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.3.0 published on Thursday, Sep 28, 2023 by Pulumi

    Creates and manages an AWS IoT Authorizer.

    Example Usage

    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.Iot.Authorizer("example", new()
        {
            AuthorizerFunctionArn = aws_lambda_function.Example.Arn,
            SigningDisabled = false,
            Status = "ACTIVE",
            TokenKeyName = "Token-Header",
            TokenSigningPublicKeys = 
            {
                { "Key1", File.ReadAllText("test-fixtures/iot-authorizer-signing-key.pem") },
            },
        });
    
    });
    
    package main
    
    import (
    	"os"
    
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iot"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func readFileOrPanic(path string) pulumi.StringPtrInput {
    	data, err := os.ReadFile(path)
    	if err != nil {
    		panic(err.Error())
    	}
    	return pulumi.String(string(data))
    }
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := iot.NewAuthorizer(ctx, "example", &iot.AuthorizerArgs{
    			AuthorizerFunctionArn: pulumi.Any(aws_lambda_function.Example.Arn),
    			SigningDisabled:       pulumi.Bool(false),
    			Status:                pulumi.String("ACTIVE"),
    			TokenKeyName:          pulumi.String("Token-Header"),
    			TokenSigningPublicKeys: pulumi.StringMap{
    				"Key1": readFileOrPanic("test-fixtures/iot-authorizer-signing-key.pem"),
    			},
    		})
    		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.iot.Authorizer;
    import com.pulumi.aws.iot.AuthorizerArgs;
    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) {
            var example = new Authorizer("example", AuthorizerArgs.builder()        
                .authorizerFunctionArn(aws_lambda_function.example().arn())
                .signingDisabled(false)
                .status("ACTIVE")
                .tokenKeyName("Token-Header")
                .tokenSigningPublicKeys(Map.of("Key1", Files.readString(Paths.get("test-fixtures/iot-authorizer-signing-key.pem"))))
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.iot.Authorizer("example",
        authorizer_function_arn=aws_lambda_function["example"]["arn"],
        signing_disabled=False,
        status="ACTIVE",
        token_key_name="Token-Header",
        token_signing_public_keys={
            "Key1": (lambda path: open(path).read())("test-fixtures/iot-authorizer-signing-key.pem"),
        })
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    import * as fs from "fs";
    
    const example = new aws.iot.Authorizer("example", {
        authorizerFunctionArn: aws_lambda_function.example.arn,
        signingDisabled: false,
        status: "ACTIVE",
        tokenKeyName: "Token-Header",
        tokenSigningPublicKeys: {
            Key1: fs.readFileSync("test-fixtures/iot-authorizer-signing-key.pem"),
        },
    });
    
    resources:
      example:
        type: aws:iot:Authorizer
        properties:
          authorizerFunctionArn: ${aws_lambda_function.example.arn}
          signingDisabled: false
          status: ACTIVE
          tokenKeyName: Token-Header
          tokenSigningPublicKeys:
            Key1:
              fn::readFile: test-fixtures/iot-authorizer-signing-key.pem
    

    Create Authorizer Resource

    new Authorizer(name: string, args: AuthorizerArgs, opts?: CustomResourceOptions);
    @overload
    def Authorizer(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   authorizer_function_arn: Optional[str] = None,
                   enable_caching_for_http: Optional[bool] = None,
                   name: Optional[str] = None,
                   signing_disabled: Optional[bool] = None,
                   status: Optional[str] = None,
                   token_key_name: Optional[str] = None,
                   token_signing_public_keys: Optional[Mapping[str, str]] = None)
    @overload
    def Authorizer(resource_name: str,
                   args: AuthorizerArgs,
                   opts: Optional[ResourceOptions] = None)
    func NewAuthorizer(ctx *Context, name string, args AuthorizerArgs, opts ...ResourceOption) (*Authorizer, error)
    public Authorizer(string name, AuthorizerArgs args, CustomResourceOptions? opts = null)
    public Authorizer(String name, AuthorizerArgs args)
    public Authorizer(String name, AuthorizerArgs args, CustomResourceOptions options)
    
    type: aws:iot:Authorizer
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args AuthorizerArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args AuthorizerArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args AuthorizerArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AuthorizerArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AuthorizerArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Authorizer Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Authorizer resource accepts the following input properties:

    AuthorizerFunctionArn string

    The ARN of the authorizer's Lambda function.

    EnableCachingForHttp bool

    Specifies whether the HTTP caching is enabled or not. Default: false.

    Name string

    The name of the authorizer.

    SigningDisabled bool

    Specifies whether AWS IoT validates the token signature in an authorization request. Default: false.

    Status string

    The status of Authorizer request at creation. Valid values: ACTIVE, INACTIVE. Default: ACTIVE.

    TokenKeyName string

    The name of the token key used to extract the token from the HTTP headers. This value is required if signing is enabled in your authorizer.

    TokenSigningPublicKeys Dictionary<string, string>

    The public keys used to verify the digital signature returned by your custom authentication service. This value is required if signing is enabled in your authorizer.

    AuthorizerFunctionArn string

    The ARN of the authorizer's Lambda function.

    EnableCachingForHttp bool

    Specifies whether the HTTP caching is enabled or not. Default: false.

    Name string

    The name of the authorizer.

    SigningDisabled bool

    Specifies whether AWS IoT validates the token signature in an authorization request. Default: false.

    Status string

    The status of Authorizer request at creation. Valid values: ACTIVE, INACTIVE. Default: ACTIVE.

    TokenKeyName string

    The name of the token key used to extract the token from the HTTP headers. This value is required if signing is enabled in your authorizer.

    TokenSigningPublicKeys map[string]string

    The public keys used to verify the digital signature returned by your custom authentication service. This value is required if signing is enabled in your authorizer.

    authorizerFunctionArn String

    The ARN of the authorizer's Lambda function.

    enableCachingForHttp Boolean

    Specifies whether the HTTP caching is enabled or not. Default: false.

    name String

    The name of the authorizer.

    signingDisabled Boolean

    Specifies whether AWS IoT validates the token signature in an authorization request. Default: false.

    status String

    The status of Authorizer request at creation. Valid values: ACTIVE, INACTIVE. Default: ACTIVE.

    tokenKeyName String

    The name of the token key used to extract the token from the HTTP headers. This value is required if signing is enabled in your authorizer.

    tokenSigningPublicKeys Map<String,String>

    The public keys used to verify the digital signature returned by your custom authentication service. This value is required if signing is enabled in your authorizer.

    authorizerFunctionArn string

    The ARN of the authorizer's Lambda function.

    enableCachingForHttp boolean

    Specifies whether the HTTP caching is enabled or not. Default: false.

    name string

    The name of the authorizer.

    signingDisabled boolean

    Specifies whether AWS IoT validates the token signature in an authorization request. Default: false.

    status string

    The status of Authorizer request at creation. Valid values: ACTIVE, INACTIVE. Default: ACTIVE.

    tokenKeyName string

    The name of the token key used to extract the token from the HTTP headers. This value is required if signing is enabled in your authorizer.

    tokenSigningPublicKeys {[key: string]: string}

    The public keys used to verify the digital signature returned by your custom authentication service. This value is required if signing is enabled in your authorizer.

    authorizer_function_arn str

    The ARN of the authorizer's Lambda function.

    enable_caching_for_http bool

    Specifies whether the HTTP caching is enabled or not. Default: false.

    name str

    The name of the authorizer.

    signing_disabled bool

    Specifies whether AWS IoT validates the token signature in an authorization request. Default: false.

    status str

    The status of Authorizer request at creation. Valid values: ACTIVE, INACTIVE. Default: ACTIVE.

    token_key_name str

    The name of the token key used to extract the token from the HTTP headers. This value is required if signing is enabled in your authorizer.

    token_signing_public_keys Mapping[str, str]

    The public keys used to verify the digital signature returned by your custom authentication service. This value is required if signing is enabled in your authorizer.

    authorizerFunctionArn String

    The ARN of the authorizer's Lambda function.

    enableCachingForHttp Boolean

    Specifies whether the HTTP caching is enabled or not. Default: false.

    name String

    The name of the authorizer.

    signingDisabled Boolean

    Specifies whether AWS IoT validates the token signature in an authorization request. Default: false.

    status String

    The status of Authorizer request at creation. Valid values: ACTIVE, INACTIVE. Default: ACTIVE.

    tokenKeyName String

    The name of the token key used to extract the token from the HTTP headers. This value is required if signing is enabled in your authorizer.

    tokenSigningPublicKeys Map<String>

    The public keys used to verify the digital signature returned by your custom authentication service. This value is required if signing is enabled in your authorizer.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Authorizer resource produces the following output properties:

    Arn string

    The ARN of the authorizer.

    Id string

    The provider-assigned unique ID for this managed resource.

    Arn string

    The ARN of the authorizer.

    Id string

    The provider-assigned unique ID for this managed resource.

    arn String

    The ARN of the authorizer.

    id String

    The provider-assigned unique ID for this managed resource.

    arn string

    The ARN of the authorizer.

    id string

    The provider-assigned unique ID for this managed resource.

    arn str

    The ARN of the authorizer.

    id str

    The provider-assigned unique ID for this managed resource.

    arn String

    The ARN of the authorizer.

    id String

    The provider-assigned unique ID for this managed resource.

    Look up Existing Authorizer Resource

    Get an existing Authorizer resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: AuthorizerState, opts?: CustomResourceOptions): Authorizer
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            arn: Optional[str] = None,
            authorizer_function_arn: Optional[str] = None,
            enable_caching_for_http: Optional[bool] = None,
            name: Optional[str] = None,
            signing_disabled: Optional[bool] = None,
            status: Optional[str] = None,
            token_key_name: Optional[str] = None,
            token_signing_public_keys: Optional[Mapping[str, str]] = None) -> Authorizer
    func GetAuthorizer(ctx *Context, name string, id IDInput, state *AuthorizerState, opts ...ResourceOption) (*Authorizer, error)
    public static Authorizer Get(string name, Input<string> id, AuthorizerState? state, CustomResourceOptions? opts = null)
    public static Authorizer get(String name, Output<String> id, AuthorizerState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Arn string

    The ARN of the authorizer.

    AuthorizerFunctionArn string

    The ARN of the authorizer's Lambda function.

    EnableCachingForHttp bool

    Specifies whether the HTTP caching is enabled or not. Default: false.

    Name string

    The name of the authorizer.

    SigningDisabled bool

    Specifies whether AWS IoT validates the token signature in an authorization request. Default: false.

    Status string

    The status of Authorizer request at creation. Valid values: ACTIVE, INACTIVE. Default: ACTIVE.

    TokenKeyName string

    The name of the token key used to extract the token from the HTTP headers. This value is required if signing is enabled in your authorizer.

    TokenSigningPublicKeys Dictionary<string, string>

    The public keys used to verify the digital signature returned by your custom authentication service. This value is required if signing is enabled in your authorizer.

    Arn string

    The ARN of the authorizer.

    AuthorizerFunctionArn string

    The ARN of the authorizer's Lambda function.

    EnableCachingForHttp bool

    Specifies whether the HTTP caching is enabled or not. Default: false.

    Name string

    The name of the authorizer.

    SigningDisabled bool

    Specifies whether AWS IoT validates the token signature in an authorization request. Default: false.

    Status string

    The status of Authorizer request at creation. Valid values: ACTIVE, INACTIVE. Default: ACTIVE.

    TokenKeyName string

    The name of the token key used to extract the token from the HTTP headers. This value is required if signing is enabled in your authorizer.

    TokenSigningPublicKeys map[string]string

    The public keys used to verify the digital signature returned by your custom authentication service. This value is required if signing is enabled in your authorizer.

    arn String

    The ARN of the authorizer.

    authorizerFunctionArn String

    The ARN of the authorizer's Lambda function.

    enableCachingForHttp Boolean

    Specifies whether the HTTP caching is enabled or not. Default: false.

    name String

    The name of the authorizer.

    signingDisabled Boolean

    Specifies whether AWS IoT validates the token signature in an authorization request. Default: false.

    status String

    The status of Authorizer request at creation. Valid values: ACTIVE, INACTIVE. Default: ACTIVE.

    tokenKeyName String

    The name of the token key used to extract the token from the HTTP headers. This value is required if signing is enabled in your authorizer.

    tokenSigningPublicKeys Map<String,String>

    The public keys used to verify the digital signature returned by your custom authentication service. This value is required if signing is enabled in your authorizer.

    arn string

    The ARN of the authorizer.

    authorizerFunctionArn string

    The ARN of the authorizer's Lambda function.

    enableCachingForHttp boolean

    Specifies whether the HTTP caching is enabled or not. Default: false.

    name string

    The name of the authorizer.

    signingDisabled boolean

    Specifies whether AWS IoT validates the token signature in an authorization request. Default: false.

    status string

    The status of Authorizer request at creation. Valid values: ACTIVE, INACTIVE. Default: ACTIVE.

    tokenKeyName string

    The name of the token key used to extract the token from the HTTP headers. This value is required if signing is enabled in your authorizer.

    tokenSigningPublicKeys {[key: string]: string}

    The public keys used to verify the digital signature returned by your custom authentication service. This value is required if signing is enabled in your authorizer.

    arn str

    The ARN of the authorizer.

    authorizer_function_arn str

    The ARN of the authorizer's Lambda function.

    enable_caching_for_http bool

    Specifies whether the HTTP caching is enabled or not. Default: false.

    name str

    The name of the authorizer.

    signing_disabled bool

    Specifies whether AWS IoT validates the token signature in an authorization request. Default: false.

    status str

    The status of Authorizer request at creation. Valid values: ACTIVE, INACTIVE. Default: ACTIVE.

    token_key_name str

    The name of the token key used to extract the token from the HTTP headers. This value is required if signing is enabled in your authorizer.

    token_signing_public_keys Mapping[str, str]

    The public keys used to verify the digital signature returned by your custom authentication service. This value is required if signing is enabled in your authorizer.

    arn String

    The ARN of the authorizer.

    authorizerFunctionArn String

    The ARN of the authorizer's Lambda function.

    enableCachingForHttp Boolean

    Specifies whether the HTTP caching is enabled or not. Default: false.

    name String

    The name of the authorizer.

    signingDisabled Boolean

    Specifies whether AWS IoT validates the token signature in an authorization request. Default: false.

    status String

    The status of Authorizer request at creation. Valid values: ACTIVE, INACTIVE. Default: ACTIVE.

    tokenKeyName String

    The name of the token key used to extract the token from the HTTP headers. This value is required if signing is enabled in your authorizer.

    tokenSigningPublicKeys Map<String>

    The public keys used to verify the digital signature returned by your custom authentication service. This value is required if signing is enabled in your authorizer.

    Import

    Using pulumi import, import IOT Authorizers using the name. For example:

     $ pulumi import aws:iot/authorizer:Authorizer example example
    

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the aws Terraform Provider.

    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.3.0 published on Thursday, Sep 28, 2023 by Pulumi