-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.tf
58 lines (49 loc) · 1.1 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.67.0"
}
}
backend "kubernetes" {
secret_suffix = "okteto"
}
required_version = ">= 1.2.0"
}
variable "bucket_name" {
description = "Name of the S3 Bucket"
type = string
default = ""
validation {
condition = length(var.bucket_name) > 1
error_message = "Please specify the name of the S3 bucket"
}
}
variable "queue_name" {
description = "Name of the SQS Queue"
type = string
default = ""
validation {
condition = length(var.queue_name) > 1
error_message = "Please specify the name of the SQS queue"
}
}
variable "region" {
description = "AWS region"
type = string
default = "us-west-2"
}
provider "aws" {
region = var.region
}
resource "aws_s3_bucket" "checks_bucket" {
bucket = var.bucket_name
force_destroy = true
}
resource "aws_sqs_queue" "orders_queue" {
name = var.queue_name
}
output "queue_url" {
value = aws_sqs_queue.orders_queue.url
description = "The URL of the SQS queue"
}