Update a Cloud Resource Plan to a New Version
This section covers the "Update" phase of the cloud resource plan's lifecycle.
Prerequisite(s)
Overview
Cloud resource plans are immutable, meaning that once an application has been provisioned using a specific version of a cloud resource plan (e.g., a cloud database), no changes can be made to that version of the cloud resource. To make updates, you must create a new version of the cloud resource plan.
After updating the new version of the cloud resource plan, you need to follow the same lifecycle steps as with the initial version. This includes validating the new version, ensuring the scope is sufficient for the intended audience, and making it available for use.
CLI Instructions
CLI Commands - Quick Reference
Instruction | CLI Command |
---|---|
Output versioned cloud resource plan's manifest to file | wf get cloudresourceplans PLANNAME --version SEMVERSION -o yaml > MYPLAN.yaml |
Apply a versioned cloud resource plan's manifest from file | wf apply -f MYPLAN.yaml |
Update a cloud resource plan to a new version
The most effective way to update a cloud resource plan to a new version in the CLI is to output the YAML to a file, make the necessary edits, and then apply it using the wf apply
command. Ensure that you don't change the metadata name, otherwise you'll create a new cloud resource plan.
- Get the yaml for the existing cloud resource plan:
wf get cloudresourceplans sand2-az-storage --version 1.1.0 -o yaml > MYPLAN.yaml
This outputs sand2-az-storage
the cloud resource plan to file MYPLAN.yaml
.
- Edit the cloud resource plan file. Ensure that you change the following:
- Bump the cloud resource plan's version to a new version
- Check that the scope of the cloud resource plan is sufficient for the intended audience.
We recommend limiting the scope of the new version of the cloud resource plan to prevent unintended availability and usage.
apiVersion: cloudresources.appvia.io/v2beta2
kind: CloudResourcePlan
metadata:
name: sand2-az-storage <--- Don't change the name
spec:
cloud: azure
description: Azure Storage Account
inputs:
- description: Name to use for the storage account - must be unique
name: storage_account_name
type: string
validation:
default: null
required: true
scope: <--- Ensure that the scope is sufficiently narrow
allowedStages:
- nonprod
allowedWorkspaces:
- sand2
terraform:
moduleURL: https://github.com/Azure-Terraform/terraform-azurerm-storage-account
moduleVersion: v0.16.3 <--- Make your changes, for example upgrade to latest version of the module
tfVarsTemplate: |-
name = "{{ .App.Component.Inputs.storage_account_name }}"
location = "{{ .Cluster.Region }}"
replication_type = "LRS"
resource_group_name = "{{ .Cluster.Azure.InfraResourceGroupName }}"
tags = {
mytag = "value"
}
version: 1.2.0 <--- Update the version of the plan
- Apply the file:
wf apply -f MYPLAN.yaml
Web Interface Instructions
Steps
The UI properties in this section are identical to those used when creating a new cloud resource plan. For detailed information on each property, please refer to the "Create Cloud Resource Plan" section.
- Expand Admin, and then navigate to Cloud > Resources
- Select the Name of your cloud resource plan
- Select the Version of your cloud resource plan
- Click the New Version button
- Note the version of the cloud resource plan and click the Continue button
- Enter a new version in the Version field.
- Make any other updates as needed:
- Navigate to the Scope section and optionally narrow the scope as needed.
- Naviage to the Configuration and make any adjustments as needed.
- Navigate to the Summary section and review your updates.
- Navigate to the YAML section and use one of the methods to apply your changes.
We recommend limiting the scope of the new version of the cloud resource plan to prevent unintended availability and usage.
Screenshot(s)