Access - Create Access Keys - Terraform
Aim
In this demo, we'll be creating some access keys. They are the preferred way to authenticate to Piranha using client software.
Terraform
$ cd terraform/
$ terraform plan
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# module.dns-create-record.aws_route53_record.api will be created
+ resource "aws_route53_record" "api" {
+ allow_overwrite = (known after apply)
+ fqdn = (known after apply)
+ id = (known after apply)
+ name = "api.terraform-records.com"
+ records = [
+ "8.8.8.8",
]
+ ttl = 300
+ type = "A"
+ zone_id = (known after apply)
}
# module.dns-create-record.aws_route53_record.www will be created
+ resource "aws_route53_record" "www" {
+ allow_overwrite = (known after apply)
+ fqdn = (known after apply)
+ id = (known after apply)
+ name = "www.terraform-records.com"
+ records = [
+ "8.8.8.8",
]
+ ttl = 300
+ type = "A"
+ zone_id = (known after apply)
}
# module.dns-create-record.aws_route53_zone.demo will be created
+ resource "aws_route53_zone" "demo" {
+ arn = (known after apply)
+ comment = "Managed by Terraform"
+ force_destroy = false
+ id = (known after apply)
+ name = "terraform-records.com"
+ name_servers = (known after apply)
+ primary_name_server = (known after apply)
+ tags_all = (known after apply)
+ zone_id = (known after apply)
}
Plan: 3 to add, 0 to change, 0 to destroy.
╷
│ Warning: AWS account ID not found for provider
│
│ with provider["registry.terraform.io/hashicorp/aws"],
│ on provider.tf line 1, in provider "aws":
│ 1: provider "aws" {
│
│ See https://www.terraform.io/docs/providers/aws/index.html#skip_requesting_account_id for implications.
╵
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now.
$ terraform apply
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# module.dns-create-record.aws_route53_record.api will be created
+ resource "aws_route53_record" "api" {
+ allow_overwrite = (known after apply)
+ fqdn = (known after apply)
+ id = (known after apply)
+ name = "api.terraform-records.com"
+ records = [
+ "8.8.8.8",
]
+ ttl = 300
+ type = "A"
+ zone_id = (known after apply)
}
# module.dns-create-record.aws_route53_record.www will be created
+ resource "aws_route53_record" "www" {
+ allow_overwrite = (known after apply)
+ fqdn = (known after apply)
+ id = (known after apply)
+ name = "www.terraform-records.com"
+ records = [
+ "8.8.8.8",
]
+ ttl = 300
+ type = "A"
+ zone_id = (known after apply)
}
# module.dns-create-record.aws_route53_zone.demo will be created
+ resource "aws_route53_zone" "demo" {
+ arn = (known after apply)
+ comment = "Managed by Terraform"
+ force_destroy = false
+ id = (known after apply)
+ name = "terraform-records.com"
+ name_servers = (known after apply)
+ primary_name_server = (known after apply)
+ tags_all = (known after apply)
+ zone_id = (known after apply)
}
Plan: 3 to add, 0 to change, 0 to destroy.
╷
│ Warning: AWS account ID not found for provider
│
│ with provider["registry.terraform.io/hashicorp/aws"],
│ on provider.tf line 1, in provider "aws":
│ 1: provider "aws" {
│
│ See https://www.terraform.io/docs/providers/aws/index.html#skip_requesting_account_id for implications.
╵
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
module.dns-create-record.aws_route53_zone.demo: Creating...
╷
│ Warning: AWS account ID not found for provider
│
│ with provider["registry.terraform.io/hashicorp/aws"],
│ on provider.tf line 1, in provider "aws":
│ 1: provider "aws" {
│
│ See https://www.terraform.io/docs/providers/aws/index.html#skip_requesting_account_id for implications.
╵
╷
│ Error: creating Route53 Hosted Zone: InvalidClientTokenId: The security token included in the request is invalid.
│ status code: 403, request id: 408ee4f2-b7d0-469c-9d91-1e749f6e6475
│
│ with module.dns-create-record.aws_route53_zone.demo,
│ on dns-create-record/record.tf line 1, in resource "aws_route53_zone" "demo":
│ 1: resource "aws_route53_zone" "demo" {
│
╵