Move terraform files into modules
This commit is contained in:
		
							parent
							
								
									4e495dbc51
								
							
						
					
					
						commit
						bae9fe9e0f
					
				
					 14 changed files with 286 additions and 104 deletions
				
			
		
							
								
								
									
										45
									
								
								output.tf
									
										
									
									
									
								
							
							
						
						
									
										45
									
								
								output.tf
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,38 +1,14 @@
 | 
			
		|||
output "hosts" {
 | 
			
		||||
  value = {
 | 
			
		||||
    for subdomain in distinct([for record in ovh_domain_zone_record.server_records : record.subdomain]) : 
 | 
			
		||||
    subdomain => {
 | 
			
		||||
      "ipv4_address" = try(
 | 
			
		||||
        ovh_domain_zone_record.server_records["${subdomain}:ipv4"].target, 
 | 
			
		||||
        null
 | 
			
		||||
      )
 | 
			
		||||
      "ipv6_address" = try(
 | 
			
		||||
        ovh_domain_zone_record.server_records["${subdomain}:ipv6"].target, 
 | 
			
		||||
        null
 | 
			
		||||
      )
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  value = module.infrastructure.hosts
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
output "authentik_data" {
 | 
			
		||||
  value = {
 | 
			
		||||
    for key in keys(authentik_application.service_applications) : key => {
 | 
			
		||||
      "base_url"      = "${var.authentik_url}/application/o/${authentik_application.service_applications[key].slug}/"
 | 
			
		||||
      "client_id"     = authentik_provider_oauth2.service_providers[key].client_id
 | 
			
		||||
      "client_secret" = authentik_provider_oauth2.service_providers[key].client_secret
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  value = module.services.authentik_data
 | 
			
		||||
  sensitive = true
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
output "postgresql_data" {
 | 
			
		||||
  value = {
 | 
			
		||||
    for key in keys(postgresql_database.service_databases) : key => {
 | 
			
		||||
      "user"      = postgresql_role.service_roles[key].name
 | 
			
		||||
      "pass"      = postgresql_role.service_roles[key].password
 | 
			
		||||
      "database"  = postgresql_database.service_databases[key].name
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  value = module.services.postgresql_data
 | 
			
		||||
  sensitive = true
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -44,23 +20,14 @@ output "postgresql" {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
output "scaleway_data" {
 | 
			
		||||
  value = {
 | 
			
		||||
    for key in keys(scaleway_iam_application.service_applications) : key => {
 | 
			
		||||
      "access_key"   = scaleway_iam_api_key.service_keys[key].access_key
 | 
			
		||||
      "secret_key"   = scaleway_iam_api_key.service_keys[key].secret_key
 | 
			
		||||
      "name"         = scaleway_object_bucket.service_buckets[key].name
 | 
			
		||||
      "region"       = scaleway_object_bucket.service_buckets[key].region
 | 
			
		||||
      "endpoint"     = scaleway_object_bucket.service_buckets[key].endpoint
 | 
			
		||||
      "api_endpoint" = scaleway_object_bucket.service_buckets[key].api_endpoint
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  value = module.infrastructure.scaleway_data
 | 
			
		||||
  sensitive = true
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
output "scaleway_registry_endpoint_public" {
 | 
			
		||||
  value = scaleway_registry_namespace.public.endpoint
 | 
			
		||||
  value = module.infrastructure.scaleway_registry_endpoint_public
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
output "scaleway_registry_endpoint_private" {
 | 
			
		||||
  value = scaleway_registry_namespace.private.endpoint
 | 
			
		||||
  value = module.infrastructure.scaleway_registry_endpoint_private
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue