aws.iot.Authorizer
Explore with Pulumi AI
Creates and manages an AWS IoT Authorizer.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as std from "@pulumi/std";
const example = new aws.iot.Authorizer("example", {
name: "example",
authorizerFunctionArn: exampleAwsLambdaFunction.arn,
signingDisabled: false,
status: "ACTIVE",
tokenKeyName: "Token-Header",
tokenSigningPublicKeys: {
Key1: std.file({
input: "test-fixtures/iot-authorizer-signing-key.pem",
}).then(invoke => invoke.result),
},
tags: {
Name: "example",
},
});
import pulumi
import pulumi_aws as aws
import pulumi_std as std
example = aws.iot.Authorizer("example",
name="example",
authorizer_function_arn=example_aws_lambda_function["arn"],
signing_disabled=False,
status="ACTIVE",
token_key_name="Token-Header",
token_signing_public_keys={
"Key1": std.file(input="test-fixtures/iot-authorizer-signing-key.pem").result,
},
tags={
"Name": "example",
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iot"
"github.com/pulumi/pulumi-std/sdk/go/std"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
invokeFile, err := std.File(ctx, &std.FileArgs{
Input: "test-fixtures/iot-authorizer-signing-key.pem",
}, nil)
if err != nil {
return err
}
_, err = iot.NewAuthorizer(ctx, "example", &iot.AuthorizerArgs{
Name: pulumi.String("example"),
AuthorizerFunctionArn: pulumi.Any(exampleAwsLambdaFunction.Arn),
SigningDisabled: pulumi.Bool(false),
Status: pulumi.String("ACTIVE"),
TokenKeyName: pulumi.String("Token-Header"),
TokenSigningPublicKeys: pulumi.StringMap{
"Key1": pulumi.String(invokeFile.Result),
},
Tags: pulumi.StringMap{
"Name": pulumi.String("example"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Iot.Authorizer("example", new()
{
Name = "example",
AuthorizerFunctionArn = exampleAwsLambdaFunction.Arn,
SigningDisabled = false,
Status = "ACTIVE",
TokenKeyName = "Token-Header",
TokenSigningPublicKeys =
{
{ "Key1", Std.File.Invoke(new()
{
Input = "test-fixtures/iot-authorizer-signing-key.pem",
}).Apply(invoke => invoke.Result) },
},
Tags =
{
{ "Name", "example" },
},
});
});
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()
.name("example")
.authorizerFunctionArn(exampleAwsLambdaFunction.arn())
.signingDisabled(false)
.status("ACTIVE")
.tokenKeyName("Token-Header")
.tokenSigningPublicKeys(Map.of("Key1", StdFunctions.file(FileArgs.builder()
.input("test-fixtures/iot-authorizer-signing-key.pem")
.build()).result()))
.tags(Map.of("Name", "example"))
.build());
}
}
resources:
example:
type: aws:iot:Authorizer
properties:
name: example
authorizerFunctionArn: ${exampleAwsLambdaFunction.arn}
signingDisabled: false
status: ACTIVE
tokenKeyName: Token-Header
tokenSigningPublicKeys:
Key1:
fn::invoke:
Function: std:file
Arguments:
input: test-fixtures/iot-authorizer-signing-key.pem
Return: result
tags:
Name: example
Create Authorizer Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Authorizer(name: string, args: AuthorizerArgs, opts?: CustomResourceOptions);
@overload
def Authorizer(resource_name: str,
args: AuthorizerArgs,
opts: Optional[ResourceOptions] = None)
@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,
tags: Optional[Mapping[str, str]] = None,
token_key_name: Optional[str] = None,
token_signing_public_keys: Optional[Mapping[str, str]] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var exampleauthorizerResourceResourceFromIotauthorizer = new Aws.Iot.Authorizer("exampleauthorizerResourceResourceFromIotauthorizer", new()
{
AuthorizerFunctionArn = "string",
EnableCachingForHttp = false,
Name = "string",
SigningDisabled = false,
Status = "string",
Tags =
{
{ "string", "string" },
},
TokenKeyName = "string",
TokenSigningPublicKeys =
{
{ "string", "string" },
},
});
example, err := iot.NewAuthorizer(ctx, "exampleauthorizerResourceResourceFromIotauthorizer", &iot.AuthorizerArgs{
AuthorizerFunctionArn: pulumi.String("string"),
EnableCachingForHttp: pulumi.Bool(false),
Name: pulumi.String("string"),
SigningDisabled: pulumi.Bool(false),
Status: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
TokenKeyName: pulumi.String("string"),
TokenSigningPublicKeys: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var exampleauthorizerResourceResourceFromIotauthorizer = new Authorizer("exampleauthorizerResourceResourceFromIotauthorizer", AuthorizerArgs.builder()
.authorizerFunctionArn("string")
.enableCachingForHttp(false)
.name("string")
.signingDisabled(false)
.status("string")
.tags(Map.of("string", "string"))
.tokenKeyName("string")
.tokenSigningPublicKeys(Map.of("string", "string"))
.build());
exampleauthorizer_resource_resource_from_iotauthorizer = aws.iot.Authorizer("exampleauthorizerResourceResourceFromIotauthorizer",
authorizer_function_arn="string",
enable_caching_for_http=False,
name="string",
signing_disabled=False,
status="string",
tags={
"string": "string",
},
token_key_name="string",
token_signing_public_keys={
"string": "string",
})
const exampleauthorizerResourceResourceFromIotauthorizer = new aws.iot.Authorizer("exampleauthorizerResourceResourceFromIotauthorizer", {
authorizerFunctionArn: "string",
enableCachingForHttp: false,
name: "string",
signingDisabled: false,
status: "string",
tags: {
string: "string",
},
tokenKeyName: "string",
tokenSigningPublicKeys: {
string: "string",
},
});
type: aws:iot:Authorizer
properties:
authorizerFunctionArn: string
enableCachingForHttp: false
name: string
signingDisabled: false
status: string
tags:
string: string
tokenKeyName: string
tokenSigningPublicKeys:
string: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Authorizer resource accepts the following input properties:
- string
- The ARN of the authorizer's Lambda function.
- Enable
Caching boolFor Http - Specifies whether the HTTP caching is enabled or not. Default:
false
. - Name string
- The name of the authorizer.
- Signing
Disabled 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
. - Dictionary<string, string>
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Token
Key stringName - 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 Dictionary<string, string>Public Keys - 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.
- string
- The ARN of the authorizer's Lambda function.
- Enable
Caching boolFor Http - Specifies whether the HTTP caching is enabled or not. Default:
false
. - Name string
- The name of the authorizer.
- Signing
Disabled 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
. - map[string]string
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Token
Key stringName - 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 map[string]stringPublic Keys - 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.
- String
- The ARN of the authorizer's Lambda function.
- enable
Caching BooleanFor Http - Specifies whether the HTTP caching is enabled or not. Default:
false
. - name String
- The name of the authorizer.
- signing
Disabled 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
. - Map<String,String>
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - token
Key StringName - 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 Map<String,String>Public Keys - 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.
- string
- The ARN of the authorizer's Lambda function.
- enable
Caching booleanFor Http - Specifies whether the HTTP caching is enabled or not. Default:
false
. - name string
- The name of the authorizer.
- signing
Disabled 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
. - {[key: string]: string}
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - token
Key stringName - 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 {[key: string]: string}Public Keys - 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.
- str
- The ARN of the authorizer's Lambda function.
- enable_
caching_ boolfor_ http - 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
. - Mapping[str, str]
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - token_
key_ strname - 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_ Mapping[str, str]public_ keys - 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.
- String
- The ARN of the authorizer's Lambda function.
- enable
Caching BooleanFor Http - Specifies whether the HTTP caching is enabled or not. Default:
false
. - name String
- The name of the authorizer.
- signing
Disabled 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
. - Map<String>
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - token
Key StringName - 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 Map<String>Public Keys - 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:
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,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, 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.
- Arn string
- The ARN of the authorizer.
- string
- The ARN of the authorizer's Lambda function.
- Enable
Caching boolFor Http - Specifies whether the HTTP caching is enabled or not. Default:
false
. - Name string
- The name of the authorizer.
- Signing
Disabled 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
. - Dictionary<string, string>
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - Token
Key stringName - 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 Dictionary<string, string>Public Keys - 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.
- string
- The ARN of the authorizer's Lambda function.
- Enable
Caching boolFor Http - Specifies whether the HTTP caching is enabled or not. Default:
false
. - Name string
- The name of the authorizer.
- Signing
Disabled 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
. - map[string]string
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - Token
Key stringName - 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 map[string]stringPublic Keys - 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.
- String
- The ARN of the authorizer's Lambda function.
- enable
Caching BooleanFor Http - Specifies whether the HTTP caching is enabled or not. Default:
false
. - name String
- The name of the authorizer.
- signing
Disabled 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
. - Map<String,String>
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - token
Key StringName - 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 Map<String,String>Public Keys - 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.
- string
- The ARN of the authorizer's Lambda function.
- enable
Caching booleanFor Http - Specifies whether the HTTP caching is enabled or not. Default:
false
. - name string
- The name of the authorizer.
- signing
Disabled 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
. - {[key: string]: string}
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - token
Key stringName - 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 {[key: string]: string}Public Keys - 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.
- str
- The ARN of the authorizer's Lambda function.
- enable_
caching_ boolfor_ http - 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
. - Mapping[str, str]
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - token_
key_ strname - 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_ Mapping[str, str]public_ keys - 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.
- String
- The ARN of the authorizer's Lambda function.
- enable
Caching BooleanFor Http - Specifies whether the HTTP caching is enabled or not. Default:
false
. - name String
- The name of the authorizer.
- signing
Disabled 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
. - Map<String>
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - token
Key StringName - 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 Map<String>Public Keys - 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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.