Implementing Terraform Templates with CoreStack
- CoreStack® 2.7.1 or later
- Role access: Admin
- Terraform scripts: You can use local file or use the GitHub link of the templates
Executing Terraform from Templates – Marketplace
- Log into CoreStack, Navigate to Templates
- Within the Templates section, you can navigate to the Terraform Templates added to the Marketplace.
- Once you’ve identified a Terraform template, hover over the icon available on the right-hand side. CoreStack now provides with option to “Plan and Execute” and “Execute” options.
Users can use Plan and Execute option, to enter the details of the template and review the details before executing the template itself.
The User additionally has an option to Change Plan if they would like to edit any details during the preview of the plan.
If the user would like to directly execute a Terraform template, they can use the Execute button.
Plan and Execute a Template
- Click on Plan and execute
- In the dialog box, enter details as required. (Refer to the appendix)
- After all the required information is entered, click on “Generate Plan” button.
- Plan and Execute dialog box shows the plan. User can scroll to review the complete plan.
- Is the user needs to make any edits, they can click on “Change Plan” button.
- If the user is satisfied with the plan, they can execute the template by clicking on “Execute Plan” button
- After clicking on “Execute Plan” user is redirected to the Templates, Job History tab where the template is queued for execution.
- Highlighting on the Job will display the Input and Task details on the right-hand side. Once the template is executed, Output section is added with the template execution details.
Create Terraform Templates
- Log into CoreStack and navigate to Templates, My Templates tab
- Click on “Create” Template button
- Enter details of the template. (Refer to Appendix)
- Once all the details are entered, click on Save.
- The template will be listed on the top, in My Templates tab
Execute a Template
- Click on Execute
- Enter information in the dialog box, with valid parameters.
- After all the information is entered. Click on Run Now
- The template will be queued for execution and will be listed on the top of Templates, Job History tab
- Once the template is executed, user can select the template and review the details on the right-hand side.
Plan and Execute Template
Inputs in Template vary according to the required parameters in template.
|Service Account||Select the Account available to you|
|Subnet Name 1||Enter a name you would want to use for Subnet 1|
|Subnet1 CIDR||Enter the CIDR information for Subnet 1|
|Subnet Name 2||Enter a name you would want to use for Subnet 2|
|Sg Name||Enter a name for the Security Group|
|Engine||Select the Execution Engine type like Terraform (Includes CFN, Mistral etc.)|
|CIDR blocks||Enter the CIDR blocks information|
|Az 1||This field will have the Availability zone 1 information|
|Az2||This field will have the Availability zone 2 information|
|Storage||Enter the Size of the Storage in GB|
|Security group name||Enter the Security Group name with which the SG will be created in Cloud|
|Username||Enter the Username that will be used to authenticate|
|Instance Class||Enter the name of the class|
|DB Name||Enter the Data base name|
|Subnetcidr||Enter the Network IP that must be created|
|Db subnet group name||Enter the Data Base Subnet name|
|Vpc id||Enter already existing VPC id in which all the resource will be created|
|Password||Enter the password for all the instance|
|Region||Select the Region in which the resource must be created|
|Name||Enter the name of the template|
|Engine Type||Select Terraform|
|Type||Select type of template|
|Services||Select the type of account (AWS or Azure)|
|Classifications||Select the classification the template will list|
|Template Content||User can either choose ‘File’ or ‘Git’ to upload the template.
Should the user choose ‘File’, then they have to navigate to the folder the template is available
If the user chooses ‘Git’, then they need to provide the Git URL from which CoreStack will retrieve the templates
|Yes, I have dependency files||If the user has module files, they can select this option and enter the details for the module files|
|Template Metadata||Here, user can add the description of the template being created|
|Tags||User can add Tags and associated value as part of It’s governance needs|