Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Iaas specific TF configs loading #38

Closed
gberche-orange opened this issue Oct 18, 2017 · 1 comment
Closed

Support Iaas specific TF configs loading #38

gberche-orange opened this issue Oct 18, 2017 · 1 comment

Comments

@gberche-orange
Copy link
Member

gberche-orange commented Oct 18, 2017

This is a refinement of the iaas-specifics-support to include terraform resource.

Currently, the current automation picks all TF config files.

# copy spec in spec, preserving the nested modules if any
find spec-resource/${SPEC_PATH}/ -mindepth 1 -maxdepth 1 -exec cp --verbose -r {} spec-applied/ \;
# copy spec in secrets, preserving the nested modules if any
if [ -d "secret-state-resource/${SPEC_PATH}" ]
then
find secret-state-resource/${SPEC_PATH}/ -mindepth 1 -maxdepth 1 -exec cp --verbose -r {} spec-applied/ \;
fi

Sharing the same cf-ops-automation based templates across root deployments leveraging distinct TF config (e.g. openstack and cloudstack) is likely to dammage TF config readeability

The apparent TF syntax support is the conditional support in interpolation:

    A common use case for conditionals is to enable/disable a resource by conditionally setting the count:

    resource "aws_instance" "vpn" {
      count = "${var.something ? 1 : 0}"
    }

    In the example above, the "vpn" resource will only be included if "var.something" evaluates to true. Otherwise, the VPN resource will not be created at all.

Wrapping this logic into modules only enables to factor out the conditionals variable and does not alleviate the readability issue causes in every invoked resources having the conditional count interpolation as illustrated into hashicorp/terraform#12906 (comment)

It may make more sense to conditionally load different TF config files depending on a per root deployment flag (such as in ci-deployment-overview.yml ci-deployment.x-depl.terraform_config.iaas_spec-prefix)

This may for instance translate into naming convention on additional directories where to fetch iaas-specific spec files such as "specs-openstack" and "specs-cloudstack"

@o-orand
Copy link
Member

o-orand commented Mar 22, 2018

Existing Iaas_type works for bosh deployment has been make through #60 and #102.

o-orand added a commit that referenced this issue Apr 24, 2018
To use iaas_type support in terraform, create a directory called `spec-<iaas-type>` beside `spec` dir.

close #38
o-orand added a commit that referenced this issue Apr 24, 2018
To use iaas_type support in terraform, create a directory called `spec-<iaas-type>` beside `spec` dir.

close #38
o-orand added a commit that referenced this issue Jun 19, 2018
with #38, this pipeline was left behind, we add the missing environment
variable.

closes #151
o-orand added a commit that referenced this issue Jun 20, 2018
with #38, this pipeline was left behind, we add the missing environment
variable.

closes #151
lucaspinto pushed a commit that referenced this issue Jul 11, 2018
To use iaas_type support in terraform, create a directory called `spec-<iaas-type>` beside `spec` dir.

close #38
lucaspinto pushed a commit that referenced this issue Jul 11, 2018
with #38, this pipeline was left behind, we add the missing environment
variable.

closes #151
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants