Terraform Infrastructure as Code for AWS IoT Core Things deployment
This repo is part of AutoMagic Light project, helping automating iot things deployment in AWS.
Check aws_iot_application
README and create a .tfvars
file:
Note: find a policy example in
policy/policy.example.json
Enconde
policy/policy.example.json
in base64 format and use it foriot_policy
variable
You may use AWS CLI profile directive in aws provider section in backend.tf
file. Eg:
provider "aws" {
profile = var.aws_local_profile
region = var.region
}
You might use Environment Variables for AWS Credentials as well (works on Terraform Cloud)
$ export AWS_ACCESS_KEY_ID="<MY_AWS_ACCESS_KEY>"
$ export AWS_SECRET_ACCESS_KEY="<MY_AWS_SECRET_KEY>"
$ export AWS_DEFAULT_REGION="us-east-1"
terraform init -reconfigure -backend-config="../config/backend.conf"
terraform plan -var-file=variables.tfvars
terraform apply -auto-approve -var-file=variables.tfvars
terraform destroy -auto-approve -var-file=variables.tfvars