Try AWS Native preview for resources not in the classic version.
aws.iot.Authorizer
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
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:
- 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
.- 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
.- 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
.- 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
.- 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
.- 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
.- 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,
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
.- 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
.- 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
.- 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
.- 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
.- 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
.- 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
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.