-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathmain.tf
74 lines (60 loc) · 2.14 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
######### Terraform Provider #########
provider "aws" {
region = "eu-central-1"
access_key = "devopshobbies"
secret_key = "devopshobbies"
skip_credentials_validation = true
skip_metadata_api_check = true
skip_requesting_account_id = true
endpoints {
apigateway = "http://localhost:4566"
apigatewayv2 = "http://localhost:4566"
cloudformation = "http://localhost:4566"
cloudwatch = "http://localhost:4566"
dynamodb = "http://localhost:4566"
ec2 = "http://localhost:4566"
es = "http://localhost:4566"
elasticache = "http://localhost:4566"
firehose = "http://localhost:4566"
iam = "http://localhost:4566"
kinesis = "http://localhost:4566"
lambda = "http://localhost:4566"
rds = "http://localhost:4566"
redshift = "http://localhost:4566"
route53 = "http://localhost:4566"
s3 = "http://s3.localhost.localstack.cloud:4566"
secretsmanager = "http://localhost:4566"
ses = "http://localhost:4566"
sns = "http://localhost:4566"
sqs = "http://localhost:4566"
ssm = "http://localhost:4566"
stepfunctions = "http://localhost:4566"
sts = "http://localhost:4566"
}
}
######### DynamoDB #########
resource "aws_dynamodb_table" " devopshobbies-dev-devops-consumer-events" {
name = " devopshobbies-dev-devops-consumer-events"
read_capacity = "20"
write_capacity = "20"
hash_key = "Id"
attribute {
name = "Id"
type = "S"
}
}
######### SNS Topic #########
resource "aws_sns_topic" "sns_topic" {
name = " devopshobbies-devops-producer-events"
}
######### SQS Queue #########
resource "aws_sqs_queue" "queue" {
name = " devopshobbies-devops-consumer-events"
}
######### SNS Subscription #########
resource "aws_sns_topic_subscription" "private_http_subscription" {
topic_arn = aws_sns_topic.sns_topic.arn
protocol = "sqs"
endpoint = aws_sqs_queue.queue.arn
endpoint_auto_confirms = true
}