Connect Terraform Modules
Now that there is a test workspace to work with, it's time to connect Terraform modules and define the configuration elements that will be needed to generate the wizard form display elements in the next step.
To deploy our AWS KMS Key module, use the CloudPosse KMS Key Module. In main.tf, add the module resource block to the file:
In this section, we've set two important identifiers. First, we've chosen the Terraform resource identifier kms_key, which will be used to refer to the Terraform properties such as variables, outputs, etc at plan and apply time. Second, we've chosen the AutoCloud identifier cpkmskey which will be used to dynamically configure relationships between modules and templates for assets such as pull requests and ticket contents.
Add an empty blueprint configuration below the autocloud_module definition for the KMS key. This will be used to configure the KMS key variables for display and code generation:
The variable configurations will be configured in future steps.
To deploy our AWS S3 Bucket module, use the CloudPosse S3 Bucket Module. In main.tf, add the module resource and form configuration data resource blocks the file below the KMS key module assets:
Below the other resources in the main.tffile, add a global form configuration to consolidate variable definitions, collect global values, and define the final form configuration to display to the user:
Run terraform apply to deploy progress so far:
CloudPosse's modules make use of their label module, and the module variables are stored in two files, context.tf and variables.tf.