1. Packages
  2. AWS
  3. API Docs
  4. iot
  5. ProvisioningTemplate
AWS v6.73.0 published on Wednesday, Mar 19, 2025 by Pulumi

aws.iot.ProvisioningTemplate

Explore with Pulumi AI

Manages an IoT fleet provisioning template. For more info, see the AWS documentation on fleet provisioning.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const iotAssumeRolePolicy = aws.iam.getPolicyDocument({
    statements: [{
        actions: ["sts:AssumeRole"],
        principals: [{
            type: "Service",
            identifiers: ["iot.amazonaws.com"],
        }],
    }],
});
const iotFleetProvisioning = new aws.iam.Role("iot_fleet_provisioning", {
    name: "IoTProvisioningServiceRole",
    path: "/service-role/",
    assumeRolePolicy: iotAssumeRolePolicy.then(iotAssumeRolePolicy => iotAssumeRolePolicy.json),
});
const iotFleetProvisioningRegistration = new aws.iam.RolePolicyAttachment("iot_fleet_provisioning_registration", {
    role: iotFleetProvisioning.name,
    policyArn: "arn:aws:iam::aws:policy/service-role/AWSIoTThingsRegistration",
});
const devicePolicy = aws.iam.getPolicyDocument({
    statements: [{
        actions: ["iot:Subscribe"],
        resources: ["*"],
    }],
});
const devicePolicyPolicy = new aws.iot.Policy("device_policy", {
    name: "DevicePolicy",
    policy: devicePolicy.then(devicePolicy => devicePolicy.json),
});
const fleet = new aws.iot.ProvisioningTemplate("fleet", {
    name: "FleetTemplate",
    description: "My provisioning template",
    provisioningRoleArn: iotFleetProvisioning.arn,
    enabled: true,
    templateBody: pulumi.jsonStringify({
        Parameters: {
            SerialNumber: {
                Type: "String",
            },
        },
        Resources: {
            certificate: {
                Properties: {
                    CertificateId: {
                        Ref: "AWS::IoT::Certificate::Id",
                    },
                    Status: "Active",
                },
                Type: "AWS::IoT::Certificate",
            },
            policy: {
                Properties: {
                    PolicyName: devicePolicyPolicy.name,
                },
                Type: "AWS::IoT::Policy",
            },
        },
    }),
});
Copy
import pulumi
import json
import pulumi_aws as aws

iot_assume_role_policy = aws.iam.get_policy_document(statements=[{
    "actions": ["sts:AssumeRole"],
    "principals": [{
        "type": "Service",
        "identifiers": ["iot.amazonaws.com"],
    }],
}])
iot_fleet_provisioning = aws.iam.Role("iot_fleet_provisioning",
    name="IoTProvisioningServiceRole",
    path="/service-role/",
    assume_role_policy=iot_assume_role_policy.json)
iot_fleet_provisioning_registration = aws.iam.RolePolicyAttachment("iot_fleet_provisioning_registration",
    role=iot_fleet_provisioning.name,
    policy_arn="arn:aws:iam::aws:policy/service-role/AWSIoTThingsRegistration")
device_policy = aws.iam.get_policy_document(statements=[{
    "actions": ["iot:Subscribe"],
    "resources": ["*"],
}])
device_policy_policy = aws.iot.Policy("device_policy",
    name="DevicePolicy",
    policy=device_policy.json)
fleet = aws.iot.ProvisioningTemplate("fleet",
    name="FleetTemplate",
    description="My provisioning template",
    provisioning_role_arn=iot_fleet_provisioning.arn,
    enabled=True,
    template_body=pulumi.Output.json_dumps({
        "Parameters": {
            "SerialNumber": {
                "Type": "String",
            },
        },
        "Resources": {
            "certificate": {
                "Properties": {
                    "CertificateId": {
                        "Ref": "AWS::IoT::Certificate::Id",
                    },
                    "Status": "Active",
                },
                "Type": "AWS::IoT::Certificate",
            },
            "policy": {
                "Properties": {
                    "PolicyName": device_policy_policy.name,
                },
                "Type": "AWS::IoT::Policy",
            },
        },
    }))
Copy
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iot"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		iotAssumeRolePolicy, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
			Statements: []iam.GetPolicyDocumentStatement{
				{
					Actions: []string{
						"sts:AssumeRole",
					},
					Principals: []iam.GetPolicyDocumentStatementPrincipal{
						{
							Type: "Service",
							Identifiers: []string{
								"iot.amazonaws.com",
							},
						},
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		iotFleetProvisioning, err := iam.NewRole(ctx, "iot_fleet_provisioning", &iam.RoleArgs{
			Name:             pulumi.String("IoTProvisioningServiceRole"),
			Path:             pulumi.String("/service-role/"),
			AssumeRolePolicy: pulumi.String(iotAssumeRolePolicy.Json),
		})
		if err != nil {
			return err
		}
		_, err = iam.NewRolePolicyAttachment(ctx, "iot_fleet_provisioning_registration", &iam.RolePolicyAttachmentArgs{
			Role:      iotFleetProvisioning.Name,
			PolicyArn: pulumi.String("arn:aws:iam::aws:policy/service-role/AWSIoTThingsRegistration"),
		})
		if err != nil {
			return err
		}
		devicePolicy, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
			Statements: []iam.GetPolicyDocumentStatement{
				{
					Actions: []string{
						"iot:Subscribe",
					},
					Resources: []string{
						"*",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		devicePolicyPolicy, err := iot.NewPolicy(ctx, "device_policy", &iot.PolicyArgs{
			Name:   pulumi.String("DevicePolicy"),
			Policy: pulumi.String(devicePolicy.Json),
		})
		if err != nil {
			return err
		}
		_, err = iot.NewProvisioningTemplate(ctx, "fleet", &iot.ProvisioningTemplateArgs{
			Name:                pulumi.String("FleetTemplate"),
			Description:         pulumi.String("My provisioning template"),
			ProvisioningRoleArn: iotFleetProvisioning.Arn,
			Enabled:             pulumi.Bool(true),
			TemplateBody: devicePolicyPolicy.Name.ApplyT(func(name string) (pulumi.String, error) {
				var _zero pulumi.String
				tmpJSON0, err := json.Marshal(map[string]interface{}{
					"Parameters": map[string]interface{}{
						"SerialNumber": map[string]interface{}{
							"Type": "String",
						},
					},
					"Resources": map[string]interface{}{
						"certificate": map[string]interface{}{
							"Properties": map[string]interface{}{
								"CertificateId": map[string]interface{}{
									"Ref": "AWS::IoT::Certificate::Id",
								},
								"Status": "Active",
							},
							"Type": "AWS::IoT::Certificate",
						},
						"policy": map[string]interface{}{
							"Properties": map[string]interface{}{
								"PolicyName": name,
							},
							"Type": "AWS::IoT::Policy",
						},
					},
				})
				if err != nil {
					return _zero, err
				}
				json0 := string(tmpJSON0)
				return pulumi.String(json0), nil
			}).(pulumi.StringOutput),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var iotAssumeRolePolicy = Aws.Iam.GetPolicyDocument.Invoke(new()
    {
        Statements = new[]
        {
            new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
            {
                Actions = new[]
                {
                    "sts:AssumeRole",
                },
                Principals = new[]
                {
                    new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
                    {
                        Type = "Service",
                        Identifiers = new[]
                        {
                            "iot.amazonaws.com",
                        },
                    },
                },
            },
        },
    });

    var iotFleetProvisioning = new Aws.Iam.Role("iot_fleet_provisioning", new()
    {
        Name = "IoTProvisioningServiceRole",
        Path = "/service-role/",
        AssumeRolePolicy = iotAssumeRolePolicy.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
    });

    var iotFleetProvisioningRegistration = new Aws.Iam.RolePolicyAttachment("iot_fleet_provisioning_registration", new()
    {
        Role = iotFleetProvisioning.Name,
        PolicyArn = "arn:aws:iam::aws:policy/service-role/AWSIoTThingsRegistration",
    });

    var devicePolicy = Aws.Iam.GetPolicyDocument.Invoke(new()
    {
        Statements = new[]
        {
            new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
            {
                Actions = new[]
                {
                    "iot:Subscribe",
                },
                Resources = new[]
                {
                    "*",
                },
            },
        },
    });

    var devicePolicyPolicy = new Aws.Iot.Policy("device_policy", new()
    {
        Name = "DevicePolicy",
        PolicyDocument = devicePolicy.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
    });

    var fleet = new Aws.Iot.ProvisioningTemplate("fleet", new()
    {
        Name = "FleetTemplate",
        Description = "My provisioning template",
        ProvisioningRoleArn = iotFleetProvisioning.Arn,
        Enabled = true,
        TemplateBody = Output.JsonSerialize(Output.Create(new Dictionary<string, object?>
        {
            ["Parameters"] = new Dictionary<string, object?>
            {
                ["SerialNumber"] = new Dictionary<string, object?>
                {
                    ["Type"] = "String",
                },
            },
            ["Resources"] = new Dictionary<string, object?>
            {
                ["certificate"] = new Dictionary<string, object?>
                {
                    ["Properties"] = new Dictionary<string, object?>
                    {
                        ["CertificateId"] = new Dictionary<string, object?>
                        {
                            ["Ref"] = "AWS::IoT::Certificate::Id",
                        },
                        ["Status"] = "Active",
                    },
                    ["Type"] = "AWS::IoT::Certificate",
                },
                ["policy"] = new Dictionary<string, object?>
                {
                    ["Properties"] = new Dictionary<string, object?>
                    {
                        ["PolicyName"] = devicePolicyPolicy.Name,
                    },
                    ["Type"] = "AWS::IoT::Policy",
                },
            },
        })),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.iam.RolePolicyAttachment;
import com.pulumi.aws.iam.RolePolicyAttachmentArgs;
import com.pulumi.aws.iot.Policy;
import com.pulumi.aws.iot.PolicyArgs;
import com.pulumi.aws.iot.ProvisioningTemplate;
import com.pulumi.aws.iot.ProvisioningTemplateArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 iotAssumeRolePolicy = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
            .statements(GetPolicyDocumentStatementArgs.builder()
                .actions("sts:AssumeRole")
                .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
                    .type("Service")
                    .identifiers("iot.amazonaws.com")
                    .build())
                .build())
            .build());

        var iotFleetProvisioning = new Role("iotFleetProvisioning", RoleArgs.builder()
            .name("IoTProvisioningServiceRole")
            .path("/service-role/")
            .assumeRolePolicy(iotAssumeRolePolicy.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
            .build());

        var iotFleetProvisioningRegistration = new RolePolicyAttachment("iotFleetProvisioningRegistration", RolePolicyAttachmentArgs.builder()
            .role(iotFleetProvisioning.name())
            .policyArn("arn:aws:iam::aws:policy/service-role/AWSIoTThingsRegistration")
            .build());

        final var devicePolicy = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
            .statements(GetPolicyDocumentStatementArgs.builder()
                .actions("iot:Subscribe")
                .resources("*")
                .build())
            .build());

        var devicePolicyPolicy = new Policy("devicePolicyPolicy", PolicyArgs.builder()
            .name("DevicePolicy")
            .policy(devicePolicy.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
            .build());

        var fleet = new ProvisioningTemplate("fleet", ProvisioningTemplateArgs.builder()
            .name("FleetTemplate")
            .description("My provisioning template")
            .provisioningRoleArn(iotFleetProvisioning.arn())
            .enabled(true)
            .templateBody(devicePolicyPolicy.name().applyValue(name -> serializeJson(
                jsonObject(
                    jsonProperty("Parameters", jsonObject(
                        jsonProperty("SerialNumber", jsonObject(
                            jsonProperty("Type", "String")
                        ))
                    )),
                    jsonProperty("Resources", jsonObject(
                        jsonProperty("certificate", jsonObject(
                            jsonProperty("Properties", jsonObject(
                                jsonProperty("CertificateId", jsonObject(
                                    jsonProperty("Ref", "AWS::IoT::Certificate::Id")
                                )),
                                jsonProperty("Status", "Active")
                            )),
                            jsonProperty("Type", "AWS::IoT::Certificate")
                        )),
                        jsonProperty("policy", jsonObject(
                            jsonProperty("Properties", jsonObject(
                                jsonProperty("PolicyName", name)
                            )),
                            jsonProperty("Type", "AWS::IoT::Policy")
                        ))
                    ))
                ))))
            .build());

    }
}
Copy
resources:
  iotFleetProvisioning:
    type: aws:iam:Role
    name: iot_fleet_provisioning
    properties:
      name: IoTProvisioningServiceRole
      path: /service-role/
      assumeRolePolicy: ${iotAssumeRolePolicy.json}
  iotFleetProvisioningRegistration:
    type: aws:iam:RolePolicyAttachment
    name: iot_fleet_provisioning_registration
    properties:
      role: ${iotFleetProvisioning.name}
      policyArn: arn:aws:iam::aws:policy/service-role/AWSIoTThingsRegistration
  devicePolicyPolicy:
    type: aws:iot:Policy
    name: device_policy
    properties:
      name: DevicePolicy
      policy: ${devicePolicy.json}
  fleet:
    type: aws:iot:ProvisioningTemplate
    properties:
      name: FleetTemplate
      description: My provisioning template
      provisioningRoleArn: ${iotFleetProvisioning.arn}
      enabled: true
      templateBody:
        fn::toJSON:
          Parameters:
            SerialNumber:
              Type: String
          Resources:
            certificate:
              Properties:
                CertificateId:
                  Ref: AWS::IoT::Certificate::Id
                Status: Active
              Type: AWS::IoT::Certificate
            policy:
              Properties:
                PolicyName: ${devicePolicyPolicy.name}
              Type: AWS::IoT::Policy
variables:
  iotAssumeRolePolicy:
    fn::invoke:
      function: aws:iam:getPolicyDocument
      arguments:
        statements:
          - actions:
              - sts:AssumeRole
            principals:
              - type: Service
                identifiers:
                  - iot.amazonaws.com
  devicePolicy:
    fn::invoke:
      function: aws:iam:getPolicyDocument
      arguments:
        statements:
          - actions:
              - iot:Subscribe
            resources:
              - '*'
Copy

Create ProvisioningTemplate Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ProvisioningTemplate(name: string, args: ProvisioningTemplateArgs, opts?: CustomResourceOptions);
@overload
def ProvisioningTemplate(resource_name: str,
                         args: ProvisioningTemplateArgs,
                         opts: Optional[ResourceOptions] = None)

@overload
def ProvisioningTemplate(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         provisioning_role_arn: Optional[str] = None,
                         template_body: Optional[str] = None,
                         description: Optional[str] = None,
                         enabled: Optional[bool] = None,
                         name: Optional[str] = None,
                         pre_provisioning_hook: Optional[ProvisioningTemplatePreProvisioningHookArgs] = None,
                         tags: Optional[Mapping[str, str]] = None,
                         type: Optional[str] = None)
func NewProvisioningTemplate(ctx *Context, name string, args ProvisioningTemplateArgs, opts ...ResourceOption) (*ProvisioningTemplate, error)
public ProvisioningTemplate(string name, ProvisioningTemplateArgs args, CustomResourceOptions? opts = null)
public ProvisioningTemplate(String name, ProvisioningTemplateArgs args)
public ProvisioningTemplate(String name, ProvisioningTemplateArgs args, CustomResourceOptions options)
type: aws:iot:ProvisioningTemplate
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ProvisioningTemplateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ProvisioningTemplateArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ProvisioningTemplateArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ProvisioningTemplateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ProvisioningTemplateArgs
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 provisioningTemplateResource = new Aws.Iot.ProvisioningTemplate("provisioningTemplateResource", new()
{
    ProvisioningRoleArn = "string",
    TemplateBody = "string",
    Description = "string",
    Enabled = false,
    Name = "string",
    PreProvisioningHook = new Aws.Iot.Inputs.ProvisioningTemplatePreProvisioningHookArgs
    {
        TargetArn = "string",
        PayloadVersion = "string",
    },
    Tags = 
    {
        { "string", "string" },
    },
    Type = "string",
});
Copy
example, err := iot.NewProvisioningTemplate(ctx, "provisioningTemplateResource", &iot.ProvisioningTemplateArgs{
	ProvisioningRoleArn: pulumi.String("string"),
	TemplateBody:        pulumi.String("string"),
	Description:         pulumi.String("string"),
	Enabled:             pulumi.Bool(false),
	Name:                pulumi.String("string"),
	PreProvisioningHook: &iot.ProvisioningTemplatePreProvisioningHookArgs{
		TargetArn:      pulumi.String("string"),
		PayloadVersion: pulumi.String("string"),
	},
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Type: pulumi.String("string"),
})
Copy
var provisioningTemplateResource = new ProvisioningTemplate("provisioningTemplateResource", ProvisioningTemplateArgs.builder()
    .provisioningRoleArn("string")
    .templateBody("string")
    .description("string")
    .enabled(false)
    .name("string")
    .preProvisioningHook(ProvisioningTemplatePreProvisioningHookArgs.builder()
        .targetArn("string")
        .payloadVersion("string")
        .build())
    .tags(Map.of("string", "string"))
    .type("string")
    .build());
Copy
provisioning_template_resource = aws.iot.ProvisioningTemplate("provisioningTemplateResource",
    provisioning_role_arn="string",
    template_body="string",
    description="string",
    enabled=False,
    name="string",
    pre_provisioning_hook={
        "target_arn": "string",
        "payload_version": "string",
    },
    tags={
        "string": "string",
    },
    type="string")
Copy
const provisioningTemplateResource = new aws.iot.ProvisioningTemplate("provisioningTemplateResource", {
    provisioningRoleArn: "string",
    templateBody: "string",
    description: "string",
    enabled: false,
    name: "string",
    preProvisioningHook: {
        targetArn: "string",
        payloadVersion: "string",
    },
    tags: {
        string: "string",
    },
    type: "string",
});
Copy
type: aws:iot:ProvisioningTemplate
properties:
    description: string
    enabled: false
    name: string
    preProvisioningHook:
        payloadVersion: string
        targetArn: string
    provisioningRoleArn: string
    tags:
        string: string
    templateBody: string
    type: string
Copy

ProvisioningTemplate 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 ProvisioningTemplate resource accepts the following input properties:

ProvisioningRoleArn This property is required. string
The role ARN for the role associated with the fleet provisioning template. This IoT role grants permission to provision a device.
TemplateBody This property is required. string
The JSON formatted contents of the fleet provisioning template.
Description string
The description of the fleet provisioning template.
Enabled bool
True to enable the fleet provisioning template, otherwise false.
Name Changes to this property will trigger replacement. string
The name of the fleet provisioning template.
PreProvisioningHook ProvisioningTemplatePreProvisioningHook
Creates a pre-provisioning hook template. Details below.
Tags Dictionary<string, string>
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Type Changes to this property will trigger replacement. string
The type you define in a provisioning template.
ProvisioningRoleArn This property is required. string
The role ARN for the role associated with the fleet provisioning template. This IoT role grants permission to provision a device.
TemplateBody This property is required. string
The JSON formatted contents of the fleet provisioning template.
Description string
The description of the fleet provisioning template.
Enabled bool
True to enable the fleet provisioning template, otherwise false.
Name Changes to this property will trigger replacement. string
The name of the fleet provisioning template.
PreProvisioningHook ProvisioningTemplatePreProvisioningHookArgs
Creates a pre-provisioning hook template. Details below.
Tags map[string]string
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Type Changes to this property will trigger replacement. string
The type you define in a provisioning template.
provisioningRoleArn This property is required. String
The role ARN for the role associated with the fleet provisioning template. This IoT role grants permission to provision a device.
templateBody This property is required. String
The JSON formatted contents of the fleet provisioning template.
description String
The description of the fleet provisioning template.
enabled Boolean
True to enable the fleet provisioning template, otherwise false.
name Changes to this property will trigger replacement. String
The name of the fleet provisioning template.
preProvisioningHook ProvisioningTemplatePreProvisioningHook
Creates a pre-provisioning hook template. Details below.
tags Map<String,String>
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
type Changes to this property will trigger replacement. String
The type you define in a provisioning template.
provisioningRoleArn This property is required. string
The role ARN for the role associated with the fleet provisioning template. This IoT role grants permission to provision a device.
templateBody This property is required. string
The JSON formatted contents of the fleet provisioning template.
description string
The description of the fleet provisioning template.
enabled boolean
True to enable the fleet provisioning template, otherwise false.
name Changes to this property will trigger replacement. string
The name of the fleet provisioning template.
preProvisioningHook ProvisioningTemplatePreProvisioningHook
Creates a pre-provisioning hook template. Details below.
tags {[key: string]: string}
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
type Changes to this property will trigger replacement. string
The type you define in a provisioning template.
provisioning_role_arn This property is required. str
The role ARN for the role associated with the fleet provisioning template. This IoT role grants permission to provision a device.
template_body This property is required. str
The JSON formatted contents of the fleet provisioning template.
description str
The description of the fleet provisioning template.
enabled bool
True to enable the fleet provisioning template, otherwise false.
name Changes to this property will trigger replacement. str
The name of the fleet provisioning template.
pre_provisioning_hook ProvisioningTemplatePreProvisioningHookArgs
Creates a pre-provisioning hook template. Details below.
tags Mapping[str, str]
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
type Changes to this property will trigger replacement. str
The type you define in a provisioning template.
provisioningRoleArn This property is required. String
The role ARN for the role associated with the fleet provisioning template. This IoT role grants permission to provision a device.
templateBody This property is required. String
The JSON formatted contents of the fleet provisioning template.
description String
The description of the fleet provisioning template.
enabled Boolean
True to enable the fleet provisioning template, otherwise false.
name Changes to this property will trigger replacement. String
The name of the fleet provisioning template.
preProvisioningHook Property Map
Creates a pre-provisioning hook template. Details below.
tags Map<String>
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
type Changes to this property will trigger replacement. String
The type you define in a provisioning template.

Outputs

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

Arn string
The ARN that identifies the provisioning template.
DefaultVersionId int
The default version of the fleet provisioning template.
Id string
The provider-assigned unique ID for this managed resource.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Arn string
The ARN that identifies the provisioning template.
DefaultVersionId int
The default version of the fleet provisioning template.
Id string
The provider-assigned unique ID for this managed resource.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn String
The ARN that identifies the provisioning template.
defaultVersionId Integer
The default version of the fleet provisioning template.
id String
The provider-assigned unique ID for this managed resource.
tagsAll Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn string
The ARN that identifies the provisioning template.
defaultVersionId number
The default version of the fleet provisioning template.
id string
The provider-assigned unique ID for this managed resource.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn str
The ARN that identifies the provisioning template.
default_version_id int
The default version of the fleet provisioning template.
id str
The provider-assigned unique ID for this managed resource.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn String
The ARN that identifies the provisioning template.
defaultVersionId Number
The default version of the fleet provisioning template.
id String
The provider-assigned unique ID for this managed resource.
tagsAll Map<String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Look up Existing ProvisioningTemplate Resource

Get an existing ProvisioningTemplate 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?: ProvisioningTemplateState, opts?: CustomResourceOptions): ProvisioningTemplate
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        default_version_id: Optional[int] = None,
        description: Optional[str] = None,
        enabled: Optional[bool] = None,
        name: Optional[str] = None,
        pre_provisioning_hook: Optional[ProvisioningTemplatePreProvisioningHookArgs] = None,
        provisioning_role_arn: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        template_body: Optional[str] = None,
        type: Optional[str] = None) -> ProvisioningTemplate
func GetProvisioningTemplate(ctx *Context, name string, id IDInput, state *ProvisioningTemplateState, opts ...ResourceOption) (*ProvisioningTemplate, error)
public static ProvisioningTemplate Get(string name, Input<string> id, ProvisioningTemplateState? state, CustomResourceOptions? opts = null)
public static ProvisioningTemplate get(String name, Output<String> id, ProvisioningTemplateState state, CustomResourceOptions options)
resources:  _:    type: aws:iot:ProvisioningTemplate    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 that identifies the provisioning template.
DefaultVersionId int
The default version of the fleet provisioning template.
Description string
The description of the fleet provisioning template.
Enabled bool
True to enable the fleet provisioning template, otherwise false.
Name Changes to this property will trigger replacement. string
The name of the fleet provisioning template.
PreProvisioningHook ProvisioningTemplatePreProvisioningHook
Creates a pre-provisioning hook template. Details below.
ProvisioningRoleArn string
The role ARN for the role associated with the fleet provisioning template. This IoT role grants permission to provision a device.
Tags Dictionary<string, string>
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

TemplateBody string
The JSON formatted contents of the fleet provisioning template.
Type Changes to this property will trigger replacement. string
The type you define in a provisioning template.
Arn string
The ARN that identifies the provisioning template.
DefaultVersionId int
The default version of the fleet provisioning template.
Description string
The description of the fleet provisioning template.
Enabled bool
True to enable the fleet provisioning template, otherwise false.
Name Changes to this property will trigger replacement. string
The name of the fleet provisioning template.
PreProvisioningHook ProvisioningTemplatePreProvisioningHookArgs
Creates a pre-provisioning hook template. Details below.
ProvisioningRoleArn string
The role ARN for the role associated with the fleet provisioning template. This IoT role grants permission to provision a device.
Tags map[string]string
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

TemplateBody string
The JSON formatted contents of the fleet provisioning template.
Type Changes to this property will trigger replacement. string
The type you define in a provisioning template.
arn String
The ARN that identifies the provisioning template.
defaultVersionId Integer
The default version of the fleet provisioning template.
description String
The description of the fleet provisioning template.
enabled Boolean
True to enable the fleet provisioning template, otherwise false.
name Changes to this property will trigger replacement. String
The name of the fleet provisioning template.
preProvisioningHook ProvisioningTemplatePreProvisioningHook
Creates a pre-provisioning hook template. Details below.
provisioningRoleArn String
The role ARN for the role associated with the fleet provisioning template. This IoT role grants permission to provision a device.
tags Map<String,String>
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

templateBody String
The JSON formatted contents of the fleet provisioning template.
type Changes to this property will trigger replacement. String
The type you define in a provisioning template.
arn string
The ARN that identifies the provisioning template.
defaultVersionId number
The default version of the fleet provisioning template.
description string
The description of the fleet provisioning template.
enabled boolean
True to enable the fleet provisioning template, otherwise false.
name Changes to this property will trigger replacement. string
The name of the fleet provisioning template.
preProvisioningHook ProvisioningTemplatePreProvisioningHook
Creates a pre-provisioning hook template. Details below.
provisioningRoleArn string
The role ARN for the role associated with the fleet provisioning template. This IoT role grants permission to provision a device.
tags {[key: string]: string}
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

templateBody string
The JSON formatted contents of the fleet provisioning template.
type Changes to this property will trigger replacement. string
The type you define in a provisioning template.
arn str
The ARN that identifies the provisioning template.
default_version_id int
The default version of the fleet provisioning template.
description str
The description of the fleet provisioning template.
enabled bool
True to enable the fleet provisioning template, otherwise false.
name Changes to this property will trigger replacement. str
The name of the fleet provisioning template.
pre_provisioning_hook ProvisioningTemplatePreProvisioningHookArgs
Creates a pre-provisioning hook template. Details below.
provisioning_role_arn str
The role ARN for the role associated with the fleet provisioning template. This IoT role grants permission to provision a device.
tags Mapping[str, str]
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

template_body str
The JSON formatted contents of the fleet provisioning template.
type Changes to this property will trigger replacement. str
The type you define in a provisioning template.
arn String
The ARN that identifies the provisioning template.
defaultVersionId Number
The default version of the fleet provisioning template.
description String
The description of the fleet provisioning template.
enabled Boolean
True to enable the fleet provisioning template, otherwise false.
name Changes to this property will trigger replacement. String
The name of the fleet provisioning template.
preProvisioningHook Property Map
Creates a pre-provisioning hook template. Details below.
provisioningRoleArn String
The role ARN for the role associated with the fleet provisioning template. This IoT role grants permission to provision a device.
tags Map<String>
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll Map<String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

templateBody String
The JSON formatted contents of the fleet provisioning template.
type Changes to this property will trigger replacement. String
The type you define in a provisioning template.

Supporting Types

ProvisioningTemplatePreProvisioningHook
, ProvisioningTemplatePreProvisioningHookArgs

TargetArn This property is required. string
The ARN of the target function.
PayloadVersion string
The version of the payload that was sent to the target function. The only valid (and the default) payload version is "2020-04-01".
TargetArn This property is required. string
The ARN of the target function.
PayloadVersion string
The version of the payload that was sent to the target function. The only valid (and the default) payload version is "2020-04-01".
targetArn This property is required. String
The ARN of the target function.
payloadVersion String
The version of the payload that was sent to the target function. The only valid (and the default) payload version is "2020-04-01".
targetArn This property is required. string
The ARN of the target function.
payloadVersion string
The version of the payload that was sent to the target function. The only valid (and the default) payload version is "2020-04-01".
target_arn This property is required. str
The ARN of the target function.
payload_version str
The version of the payload that was sent to the target function. The only valid (and the default) payload version is "2020-04-01".
targetArn This property is required. String
The ARN of the target function.
payloadVersion String
The version of the payload that was sent to the target function. The only valid (and the default) payload version is "2020-04-01".

Import

Using pulumi import, import IoT fleet provisioning templates using the name. For example:

$ pulumi import aws:iot/provisioningTemplate:ProvisioningTemplate fleet FleetProvisioningTemplate
Copy

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.