-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
68 lines (58 loc) · 2.2 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
terraform {
cloud {
organization = "signalroom"
workspaces {
name = "apache-flink-kickstarter-0014"
}
}
# Using the "pessimistic constraint operators" for all the Providers to ensure
# that the provider version is compatible with the configuration. Meaning
# only patch-level updates are allowed but minor-level and major-level
# updates of the Providers are not allowed
required_providers {
confluent = {
source = "confluentinc/confluent"
version = "~> 2.12.0"
}
aws = {
source = "hashicorp/aws"
version = "~> 5.81.0"
}
snowflake = {
source = "Snowflake-Labs/snowflake"
version = "~> 1.0.0"
}
}
}
locals {
cloud = "AWS"
secrets_insert = lower(var.service_account_user)
confluent_secrets_path_prefix = "/confluent_cloud_resource/${local.secrets_insert}"
snowflake_secrets_path_prefix = "/snowflake_resource/${local.secrets_insert}"
snowflake_aws_role_name = "snowflake_role"
snowflake_aws_role_arn = "arn:aws:iam::${var.aws_account_id}:role/${local.snowflake_aws_role_name}"
}
# Create the Snowflake user RSA keys pairs
module "snowflake_user_rsa_key_pairs_rotation" {
source = "github.com/j3-signalroom/iac-snowflake-user-rsa_key_pairs_rotation-tf_module"
# Required Input(s)
aws_region = var.aws_region
aws_account_id = var.aws_account_id
snowflake_account = jsondecode(data.aws_secretsmanager_secret_version.admin_public_keys.secret_string)["account"]
service_account_user = var.service_account_user
# Optional Input(s)
secret_insert = local.secrets_insert
day_count = var.day_count
aws_lambda_memory_size = var.aws_lambda_memory_size
aws_lambda_timeout = var.aws_lambda_timeout
aws_log_retention_in_days = var.aws_log_retention_in_days
}
# Reference the Confluent Cloud
data "confluent_organization" "env" {}
# Create the Confluent Cloud Environment
resource "confluent_environment" "env" {
display_name = "${local.secrets_insert}"
stream_governance {
package = "ESSENTIALS"
}
}