Create AWS IOT required resources and export needed configurations.
- things for each device id
- thing-certificate
- thing-policy
- thing-assume-with-cert-policy
- thing-service-role to access aws services via thing-certificate
- thing-service-role-alias
- thing-shadow-rule to sending shadow data to s3 bucket
- thing-aws-resources
- thing-deployment-bucket:
- thing-shadow-bucket
- thing-shadow-table to querying shadow data from athena
- thing-deploy-policy
- thing-deploy-role to access aws resources with role
- thing-deploy-user to access aws resources with user
- thing-configurations
- thing-certificate as file
- thing-certificate-public-key as file
- thing-certificate-private-key as file
- conf.json
conf.json
{
"devices": ["dev-gorup-dev-id"],
"thingGroup": "dev-gorup",
"region": "eu-central-1",
"roleAlias": "my-dev-gorup-service-role-alias",
"deploymentBucket": "org-thing-my-dev-group-deployment",
"version": "2020-06-12-21-41-36"
}
uncomment terraform backend config in main.tf if you want to keep states in a s3 bucket
terraform {
backend "s3" {
bucket = "my-terraform-bucket"
key = "terraform/terraform.tfstate"
region = "eu-central-1"
}
}
run terraform commands
terraform init
terraform plan -var 'device_ids=["dev-id"]' -var 'organization_name=org' -var 'thing_group=dev-group'
terraform apply -var 'device_ids=["dev-id"]' -var 'organization_name=org' -var 'thing_group=dev-group'
- device_ids: list of unique device ids
- thing_group: name of the device group
- organization_name: name of the organization (product name etc.)
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
How to access aws resources with AWS IOT certificate and private key