Skip to content

tfstack/terraform-aws-iot-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-aws-iot-core

Terraform module for creating and managing AWS IoT Core resources

Requirements

Name Version
terraform >= 1.6
aws >= 6.0

Providers

Name Version
aws >= 6.0

Modules

No modules.

Resources

Name Type
aws_dynamodb_table.iot_data resource
aws_iot_certificate.this resource
aws_iot_policy.this resource
aws_iot_policy_attachment.existing_policy_attachments resource
aws_iot_policy_attachment.inline_policy_attachments resource
aws_iot_thing.this resource
aws_iot_thing_group.this resource
aws_iot_thing_group_membership.this resource
aws_iot_thing_principal_attachment.attachments resource
aws_iot_thing_type.this resource
aws_iot_topic_rule.this resource
aws_s3_bucket.iot_data resource
aws_s3_bucket.iot_data_force_destroy resource
aws_s3_bucket_lifecycle_configuration.iot_data resource
aws_s3_bucket_lifecycle_configuration.iot_data_force_destroy resource
aws_s3_bucket_versioning.iot_data resource
aws_s3_bucket_versioning.iot_data_force_destroy resource
aws_caller_identity.current data source
aws_iot_endpoint.current data source
aws_region.current data source

Inputs

Name Description Type Default Required
create_certificates Whether to create IoT certificates bool true no
create_dynamodb_table Whether to create a DynamoDB table for IoT data bool false no
create_s3_bucket Whether to create an S3 bucket for IoT data bool false no
dynamodb_attributes DynamoDB table attributes
list(object({
name = string
type = string
}))
[
{
"name": "deviceId",
"type": "S"
},
{
"name": "timestamp",
"type": "N"
}
]
no
dynamodb_hash_key DynamoDB table hash key string "deviceId" no
dynamodb_range_key DynamoDB table range key string "timestamp" no
dynamodb_table_name Name of the DynamoDB table for IoT data string null no
dynamodb_ttl_attribute DynamoDB TTL attribute name string "ttl" no
dynamodb_ttl_enabled Whether to enable DynamoDB TTL bool true no
name_prefix Prefix for resource names string "iot" no
policy_arn Existing IoT policy ARN (mutually exclusive with policy_json) string null no
policy_json Inline IoT policy JSON (mutually exclusive with policy_arn) string null no
policy_name Name for the inline IoT policy (required if policy_json is provided) string null no
rules Map of IoT topic rules to create
map(object({
description = optional(string)
enabled = optional(bool, true)
sql = string
sql_version = optional(string, "2016-03-23")
s3 = optional(object({
bucket_name = string
key = string
role_arn = string
}))
lambda = optional(object({
function_arn = string
}))
kinesis = optional(object({
role_arn = string
stream_name = string
partition_key = optional(string)
}))
dynamodb = optional(object({
table_name = string
hash_key_field = string
hash_key_value = string
range_key_field = optional(string)
range_key_value = optional(string)
role_arn = string
}))
cloudwatch_logs = optional(object({
log_group_name = string
role_arn = string
}))
}))
{} no
s3_bucket_name Name of the S3 bucket for IoT data string null no
s3_data_retention_days Number of days to retain data in S3 number 30 no
s3_force_destroy Whether to force destroy the S3 bucket (allows non-empty bucket deletion) bool false no
tags A map of tags to assign to the resources map(string) {} no
thing_attributes Map of attributes for IoT things map(string) {} no
thing_group_memberships Map of thing group memberships
map(object({
thing_group_name = string
thing_name = string
}))
{} no
thing_groups Map of IoT thing groups to create
map(object({
description = string
parent_group_name = optional(string)
tags = optional(map(string), {})
}))
{} no
thing_names List of IoT thing names to create list(string) [] no
thing_type_name IoT thing type name (optional) string null no
thing_types Map of IoT thing types to create
map(object({
description = string
searchable_attributes = list(string)
}))
{} no

Outputs

Name Description
account_id AWS account ID
certificate_arns List of IoT certificate ARNs
certificate_pems List of IoT certificate PEMs (sensitive)
certificate_private_keys List of IoT certificate private keys (sensitive)
certificate_public_keys List of IoT certificate public keys (sensitive)
dynamodb_table_arn DynamoDB table ARN for IoT data
dynamodb_table_name DynamoDB table name for IoT data
endpoint IoT endpoint
policy_arn IoT policy ARN (inline policy or provided ARN)
policy_name IoT policy name
region AWS region
rule_arns Map of IoT topic rule ARNs
rule_names Map of IoT topic rule names
s3_bucket_arn S3 bucket ARN for IoT data
s3_bucket_name S3 bucket name for IoT data
thing_arns List of IoT thing ARNs
thing_group_arns Map of IoT thing group ARNs
thing_group_names Map of IoT thing group names
thing_names List of IoT thing names
thing_type_arns Map of IoT thing type ARNs
thing_type_names Map of IoT thing type names

About

Terraform module for creating and managing AWS IoT Core resources

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages