Skip to content

Latest commit

 

History

History
88 lines (63 loc) · 3.53 KB

README.md

File metadata and controls

88 lines (63 loc) · 3.53 KB

CloudFoundry Service Module

Requirements

Name Version
cloudfoundry 0.51.2

Providers

Name Version
cloudfoundry 0.51.2

Modules

No modules.

Resources

Name Type
cloudfoundry_service_instance.this resource
cloudfoundry_service_key.this resource
cloudfoundry_user_provided_service.this resource

Inputs

Name Description Type Default Required
cloudfoundry Cloudfoundry settings. any n/a yes
env The settings map for this environment. any n/a yes
passwords Sensitive strings to be added to the apps environmental variables. map {} no
secrets Sensitive strings to be added to the apps environmental variables. map {} no
skip_service_instances Allows the skipping of service instances. Useful to inject service secrets into a user provided secret. bool false no
skip_user_provided_services Allows the skipping of user provided services. Useful to inject service secrets into a user provided secret. bool false no

Outputs

Name Description
name n/a
results n/a

Examples

Basic

module "services" {
  source = "./modules/service"

  cloudfoundry = local.cloudfoundry
  env = local.env
}

Advanced

This advanced example will first generate service instances, such as RDS, along with other defined services, except for the user defined services. User defined services are useful for providing variables at runtime to applications. The issue is that until a service, such as RDS is deployed, their isn't a username and password created for that instance.

The first step is to initalize any services that are not user defined, but setting skip_user_provided_services to true.

module "services" {
  source = "./modules/service"

  cloudfoundry = local.cloudfoundry
  env = local.env

  skip_user_provided_services = true
}

After the services are generated, another module block can be defined, which will pass a merged map(string) called secrets, that have the various information that is to be added to the user defined service. Setting the skip_service_instances to true will prevent the module from trying to redploy any non user defined service.

module "secrets" {
  source = "./modules/service"

  cloudfoundry = local.cloudfoundry
  env = local.env

  secrets = local.secrets
  skip_service_instances = true
}