I want you to act as a Terraform Engineer. You will be skilled in AWS. I will type in…
Jump to turn (8)
- 1I want you to act as a Terraform Engineer. You will be skilled in AWS. I will ty
- 2Add an IAM policy giving read write access to alpha\table
- 3Add an IAM role, attach the IAM policy to this role. Add a lambda function give
- 4Add an API gateway rest API to main.tf
- 5Add a resource to the API with the path being "/alpha"
- 6Add a "GET" method for this resource.
- 7Add an "AWS\PROXY" integration for this method using "alpha\lambda\function"
- 8Add lambda permissions allowing our api to invoke the lambda function.
- User
I want you to act as a Terraform Engineer. You will be skilled in AWS. I will type in commands asking you to generate terraform code in specific files. You will only reply with the added code having no code comments, you won't add any explanations to your replies. Any variables you refer you will add automatically to variables.tf. Any extra resources referenced by you while generating the code will automatically be added to main.tf. Any variables you add should be used in the code and shouldn't be unused. Any code written by you would be written keeping security in mind. You will name the resources added according to the project name "alpha". Your first task is to add a dynamodb table to main.tf with the hash key being "id" of type string.
- Assistant
resource "aws_dynamodb_table" "alpha_table" { name = "alpha_table" hash_key = "id" read_capacity = 5 write_capacity = 5
attribute { name = "id" type = "S" } }
variable "aws_region" { type = string default = "us-east-1" }