|
| 1 | +locals { |
| 2 | + rosa_cluster_name = "my-rosa" # Change this to a name of your choice |
| 3 | + |
| 4 | + rosa_cluster_zones = ["eu-north-1a", "eu-north-1b", "eu-north-1c"] # Adjust to your needs and align with your value of AWS_REGION |
| 5 | + |
| 6 | + rosa_admin_username = "kubeadmin" |
| 7 | + rosa_admin_password = "CHANGEME1234r!" # Change the password of your admin password |
| 8 | +} |
| 9 | + |
| 10 | +module "rosa_cluster" { |
| 11 | + source = "git::https://github.com/camunda/camunda-tf-rosa//modules/rosa-hcp?ref=v2.0.0" |
| 12 | + |
| 13 | + cluster_name = local.rosa_cluster_name |
| 14 | + |
| 15 | + availability_zones = local.rosa_cluster_zones |
| 16 | + |
| 17 | + # Set CIDR ranges or use the defaults |
| 18 | + vpc_cidr_block = "10.0.0.0/16" |
| 19 | + machine_cidr_block = "10.0.0.0/18" |
| 20 | + service_cidr_block = "10.0.128.0/18" |
| 21 | + pod_cidr_block = "10.0.64.0/18" |
| 22 | + |
| 23 | + # admin access |
| 24 | + htpasswd_username = local.rosa_admin_username |
| 25 | + htpasswd_password = local.rosa_admin_password |
| 26 | + |
| 27 | + # Default node type for the OpenShift cluster |
| 28 | + compute_node_instance_type = "m7i.xlarge" |
| 29 | + replicas = 6 |
| 30 | +} |
| 31 | + |
| 32 | +# Outputs of the parent module |
| 33 | + |
| 34 | +output "public_subnet_ids" { |
| 35 | + value = module.rosa_cluster.public_subnet_ids |
| 36 | + description = "A comma-separated list of public subnet IDs in the VPC. These subnets are typically used for resources that require internet access." |
| 37 | +} |
| 38 | + |
| 39 | +output "private_subnet_ids" { |
| 40 | + value = module.rosa_cluster.private_subnet_ids |
| 41 | + description = "A comma-separated list of private subnet IDs in the VPC. These subnets are typically used for internal resources that do not require direct internet access." |
| 42 | +} |
| 43 | + |
| 44 | +output "cluster_id" { |
| 45 | + value = module.rosa_cluster.cluster_id |
| 46 | + description = "The unique identifier of the OpenShift cluster created on Red Hat OpenShift Service on AWS (ROSA). This ID is used to reference the cluster in subsequent operations." |
| 47 | +} |
| 48 | + |
| 49 | +output "oidc_provider_id" { |
| 50 | + value = module.rosa_cluster.oidc_provider_id |
| 51 | + description = "OIDC provider for the ROSA cluster. Allows adding additional IAM Role for Service Accounts (IRSA) mappings." |
| 52 | +} |
| 53 | + |
| 54 | +output "aws_caller_identity_account_id" { |
| 55 | + value = module.rosa_cluster.aws_caller_identity_account_id |
| 56 | + description = "The AWS account ID of the caller. This is the account under which the Terraform code is being executed." |
| 57 | +} |
| 58 | + |
| 59 | +output "openshift_api_url" { |
| 60 | + value = module.rosa_cluster.openshift_api_url |
| 61 | + description = "The endpoint URL for accessing the OpenShift API. This endpoint is used to interact with the OpenShift cluster's API server." |
| 62 | +} |
| 63 | + |
| 64 | +output "cluster_console_url" { |
| 65 | + value = module.rosa_cluster.cluster_console_url |
| 66 | + description = "The URL endpoint for accessing the OpenShift web console. This endpoint provides a web-based user interface for managing the OpenShift cluster." |
| 67 | +} |
0 commit comments