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

Updating stack-action for Terraform and Cloudformation #363

Merged
merged 4 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 37 additions & 12 deletions docs/migration/2.0-migration.md → docs/migration.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,46 @@
Here is the list of major breaking changes that you need to be aware of when migrating from BitOps `v1.0` to `v2.0`.
Here is the list of upgrade notes for major breaking changes that you need to be aware of when migrating between the BitOps versions.

## BitOps Core
## v2.2
* Terraform plugin `stack-action` was moved from `options` to `cli` section in `bitops.config.yaml`.
You need to update your configuration from old:
```yaml
terraform:
cli: {}
options:
stack-action: "plan"
```
to the new format:
```yaml
terraform:
cli:
stack-action: "plan"
options: {}
```

* ENV variables used to skip an individual plugin deployment were updated to follow a common consistent format:
- `SKIP_DEPLOY_TERRAFORM` -> `TERRAFORM_SKIP_DEPLOY`
- `SKIP_DEPLOY_HELM` -> `HELM_SKIP_DEPLOY`
- `SKIP_DEPLOY_ANSIBLE` -> `ANSIBLE_SKIP_DEPLOY`
- `SKIP_DEPLOY_CLOUDFORMATION` -> `CFN_SKIP_DEPLOY`

---------
## v2.0

### CHANGED: `ENVIRONMENT` -> `BITOPS_ENVIRONMENT` var
### BitOps Core

#### CHANGED: `ENVIRONMENT` -> `BITOPS_ENVIRONMENT` var
BitOps is no longer using the `ENVIRONMENT` value, it instead uses `BITOPS_ENVIRONMENT`.
Please rename your variables.

### CHANGED: `BITOPS_` Export Prefixes
#### CHANGED: `BITOPS_` Export Prefixes
BitOps core exported environment variables now have a prefix of `BITOPS_`.

**Examples**

- `BITOPS_TERRAFORM_ENV_VAR`
- `BITOPS_ANSIBLE_ENV_VAR`

### CHANGED: `bitops.config.yaml` stack-action
#### CHANGED: `bitops.config.yaml` stack-action
Ops repo level `bitops.config.yaml` have had one important update; The CLI attribute `stack-action` has been added. This attribute is used to tell the BitOps plugin which method it is invoking.

For example, the terraform plugin has 3 stack-actions: `plan`, `apply`, `destroy`.
Expand All @@ -37,7 +63,7 @@ terraform:

This pattern is now used by BitOps to standardize how a plugin specifies an action.

### NEW: Default Folder Configuration
#### NEW: Default Folder Configuration
A new attribute was added to `bitops.config.yaml` to define the default folder name. This attribute is evaluated when building a BitOps custom image.

**New method**
Expand All @@ -48,9 +74,8 @@ bitops:

The compatible environment variable to override this setting is `BITOPS_DEFAULT_FOLDER`.


## Plugins
### Ansible
### Plugins
#### Ansible
*depreciated attributes*

- `ansible.cli.vault_id`
Expand All @@ -59,14 +84,14 @@ The compatible environment variable to override this setting is `BITOPS_DEFAULT_

<hr/>

### Terraform
#### Terraform
*new attributes*

- `ansible.options.init-upgrade`

<hr/>

### Helm
#### Helm
*changed attributes*

- `helm.options.uninstall-charts` --> Changed to --> `helm.options.uninstall`
Expand All @@ -80,7 +105,7 @@ The compatible environment variable to override this setting is `BITOPS_DEFAULT_

<hr/>

### Cloudformation
#### Cloudformation
*changed attributes*

- `cloudformation.options.cfn-files.parameters.enabled` --> Changed to --> `cloudformation.options.cfn-files.parameters.template-param-flag`
Expand Down
4 changes: 2 additions & 2 deletions docs/tool-configuration/configuration-cloudformation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
cloudformation:
cli:
validate-cfn: true
cfn-stack-action: deploy
stack-action: deploy
options:
cfn-stack-name: bitops-edgelambda-test
capabilities: CAPABILITY_NAMED_IAM
Expand All @@ -23,7 +23,7 @@ cloudformation:
| Property | Environmental Variable | Description | Default | Required |
| ---------------- | ---------------------- | --------------------------------------------------------- | -------- | -------- |
| validate-cfn | FN_TEMPLATE_VALIDATION | Calls `aws cloudformation validate-template` | `true` | |
| cfn-stack-action | CFN_STACK_ACTION | Controls what CloudFormation action to apply on the stack | `deploy` | |
| stack-action | CFN_STACK_ACTION | Controls what CloudFormation action to apply on the stack | `deploy` | |

## Options Configuration

Expand Down
4 changes: 2 additions & 2 deletions docs/tool-configuration/configuration-terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ terraform:
backend-config:
- KEY1=foo
- KEY2=bar
options:
stack-action: "plan"
options:
PhillypHenning marked this conversation as resolved.
Show resolved Hide resolved
workspace: test
```

Expand All @@ -39,13 +39,13 @@ Run BitOps with the environmental variable `TERRAFORM_APPLY` set to `true` or se
| var-file | BITOPS_TF_VAR_FILE | --var-file | Terraform Varaible file | `null` | No |
| target | BITOPS_TF_TARGET | --target | | `null` | No |
| backend-config | | --KEY1=foo --KEY2=bar | | `null` | No |
| stack-action | BITOPS_TERRAFORM_COMMAND | | Controls what terraform command to run. e.g. `apply`, `destroy`, etc. | `plan` | No |


## Options Configuration

| Property | Environment Variable | Description | Default | Required |
| ------------ | -------------------------- | ------------------------------------------------------------ | ------- | -------- |
| stack-action | BITOPS_TERRAFORM_COMMAND | Controls what terraform command to run. e.g. `apply`, `destroy`, etc. | `plan` | No |
| skip-deploy | TERRAFORM_SKIP_DEPLOY | If set to true, regardless of the stack-action, deployment actions will be skipped. | false | No |
| workspace | BITOPS_TERRAFORM_WORKSPACE | Will select a terraform workspace using `terraform workspace new $TERRAFORM_WORKSPACE ||terraform workspace select $TERRAFORM_WORKSPACE` prior to running other terraform commands. | `null` | No |

Expand Down
5 changes: 3 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ nav:
- Releases:
- Versioning: versioning.md
- Roadmap: roadmap.md
- Upgrade:
- v2.0: migration/2.0-migration.md
- Upgrade: migration.md
- Development:
- Local development: development-local.md
- Custom Images: custom-image.md
Expand Down Expand Up @@ -70,3 +69,5 @@ markdown_extensions:
- attr_list
- meta
- pymdownx.extra
- toc:
permalink: "#"