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

feat: deployment freezes #822

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
cf62bb2
wip
benPearce1 Nov 20, 2024
fb919c6
fixed casing on project scope
benPearce1 Nov 21, 2024
1ce7c08
refactored state cleanup to support all functions
benPearce1 Nov 21, 2024
63c094b
added date time schema
benPearce1 Nov 21, 2024
9b1ee2f
fixes for deployment freeze resources
benPearce1 Nov 21, 2024
879becd
store the supplied times in state for create and updated
benPearce1 Nov 21, 2024
84b7fe4
updated client library
benPearce1 Nov 22, 2024
a67a0b6
Merge branch 'main' into bp/deployment-freeze
benPearce1 Nov 22, 2024
b2eb8d6
update following merge
benPearce1 Nov 22, 2024
c761241
reverted incorrect change to missing resource handling
benPearce1 Nov 22, 2024
1aa7b68
added update test to project freeze
benPearce1 Nov 24, 2024
e9da4d6
refresh docs
benPearce1 Nov 25, 2024
9b70c40
extracted deployment freeze project scope out to separate resource
benPearce1 Nov 27, 2024
7660848
updated go-octopusdeploy reference
benPearce1 Nov 27, 2024
c22a0c0
updated examples
benPearce1 Nov 27, 2024
70f2a6b
updated build composite id to take params
benPearce1 Nov 28, 2024
f4ac55b
split deployment freeze project scopes to separate resource and added…
benPearce1 Nov 28, 2024
96dc497
updated go-octopusdeploy reference
benPearce1 Nov 28, 2024
e31e4f4
update go.sum
benPearce1 Nov 28, 2024
efd1d83
updated docs
benPearce1 Nov 28, 2024
9e504eb
missed return statement
benPearce1 Nov 28, 2024
b834bc4
missed return statement
benPearce1 Nov 28, 2024
91da299
updated test to perform update
benPearce1 Nov 28, 2024
268cf29
Merge branch 'main' into bp/deployment-freeze
benPearce1 Nov 28, 2024
a82d9d7
fixed up imports
benPearce1 Nov 28, 2024
dfc11c4
chore: fix docs
domenicsim1 Nov 29, 2024
872fc77
fixed formatting string
benPearce1 Nov 29, 2024
7deb89d
Merge remote-tracking branch 'refs/remotes/origin/bp/deployment-freez…
benPearce1 Nov 29, 2024
0b61d02
deleted tests for testing build issue
benPearce1 Nov 29, 2024
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
2 changes: 0 additions & 2 deletions docs/data-sources/azure_cloud_service_deployment_targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,3 @@ Read-Only:
- `upgrade_required` (Boolean)
- `upgrade_suggested` (Boolean)
- `version` (String)


Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,3 @@ Read-Only:
- `upgrade_required` (Boolean)
- `upgrade_suggested` (Boolean)
- `version` (String)


2 changes: 0 additions & 2 deletions docs/data-sources/azure_web_app_deployment_targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,3 @@ Read-Only:
- `upgrade_required` (Boolean)
- `upgrade_suggested` (Boolean)
- `version` (String)


2 changes: 0 additions & 2 deletions docs/data-sources/certificates.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,3 @@ Read-Only:
- `tenants` (List of String)
- `thumbprint` (String)
- `version` (Number)


2 changes: 0 additions & 2 deletions docs/data-sources/channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,3 @@ Read-Only:

- `deployment_action` (String)
- `package_reference` (String)


2 changes: 0 additions & 2 deletions docs/data-sources/cloud_region_deployment_targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,3 @@ Read-Only:
- `upgrade_required` (Boolean)
- `upgrade_suggested` (Boolean)
- `version` (String)


43 changes: 43 additions & 0 deletions docs/data-sources/deployment_freezes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "octopusdeploy_deployment_freezes Data Source - terraform-provider-octopusdeploy"
subcategory: ""
description: |-
Provides information about deployment freezes
---

# octopusdeploy_deployment_freezes (Data Source)

Provides information about deployment freezes



<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `environment_ids` (List of String) A filter to search by a list of environment IDs
- `ids` (List of String) A filter to search by a list of IDs.
- `include_complete` (Boolean) Include deployment freezes that completed, default is true
- `partial_name` (String) A filter to search by a partial name.
- `project_ids` (List of String) A filter to search by a list of project IDs
- `skip` (Number) A filter to specify the number of items to skip in the response.
- `status` (String) Filter by the status of the deployment freeze, value values are Expired, Active, Scheduled (case-insensitive)
- `take` (Number) A filter to specify the number of items to take (or return) in the response.

### Read-Only

- `deployment_freezes` (Attributes List) (see [below for nested schema](#nestedatt--deployment_freezes))
- `id` (String) The unique ID for this resource.

<a id="nestedatt--deployment_freezes"></a>
### Nested Schema for `deployment_freezes`

Read-Only:

- `end` (String) The end time of the freeze
- `id` (String) The unique ID for this resource.
- `name` (String) The name of this resource.
- `project_environment_scope` (Map of List of String) The project environment scope of the deployment freeze
- `start` (String) The start time of the freeze
2 changes: 0 additions & 2 deletions docs/data-sources/deployment_targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,3 @@ Read-Only:
- `upgrade_required` (Boolean)
- `upgrade_suggested` (Boolean)
- `version` (String)


2 changes: 0 additions & 2 deletions docs/data-sources/environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,3 @@ Read-Only:
Read-Only:

- `is_enabled` (Boolean)


2 changes: 0 additions & 2 deletions docs/data-sources/git_credentials.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,3 @@ Read-Only:
- `space_id` (String) The space ID associated with this Git Credential.
- `type` (String) The Git credential authentication type.
- `username` (String) The username for the Git credential.


2 changes: 0 additions & 2 deletions docs/data-sources/kubernetes_agent_deployment_targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,3 @@ Read-Only:
- `thumbprint` (String)
- `upgrade_locked` (Boolean)
- `uri` (String)


2 changes: 0 additions & 2 deletions docs/data-sources/kubernetes_agent_workers.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,3 @@ Read-Only:
- `upgrade_locked` (Boolean)
- `uri` (String)
- `worker_pool_ids` (List of String)


2 changes: 0 additions & 2 deletions docs/data-sources/kubernetes_cluster_deployment_targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,3 @@ Read-Only:
Read-Only:

- `token_path` (String)


2 changes: 0 additions & 2 deletions docs/data-sources/library_variable_sets.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,3 @@ Read-Only:
- `id` (String)
- `label` (String)
- `name` (String)


2 changes: 0 additions & 2 deletions docs/data-sources/lifecycles.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,3 @@ Read-Only:
- `quantity_to_keep` (Number) The quantity of releases to keep.
- `should_keep_forever` (Boolean) Whether releases should be kept forever.
- `unit` (String) The unit of time for the retention policy.


2 changes: 0 additions & 2 deletions docs/data-sources/listening_tentacle_deployment_targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,3 @@ Read-Only:
- `upgrade_required` (Boolean)
- `upgrade_suggested` (Boolean)
- `version` (String)


2 changes: 0 additions & 2 deletions docs/data-sources/machine.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,3 @@ description: |-
- `tenanteddeploymentparticipation` (String)
- `tenantids` (List of String)
- `tenanttags` (List of String)


2 changes: 0 additions & 2 deletions docs/data-sources/machine_policies.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,3 @@ Read-Only:
- `kubernetes_agent_update_behavior` (String)
- `tentacle_update_account_id` (String)
- `tentacle_update_behavior` (String)


2 changes: 0 additions & 2 deletions docs/data-sources/machine_proxies.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,3 @@ Read-Only:
- `port` (Number) The port number for the proxy server.
- `space_id` (String) The space ID associated with this machine proxy.
- `username` (String) Username for the proxy server


2 changes: 0 additions & 2 deletions docs/data-sources/offline_package_drop_deployment_targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,3 @@ Read-Only:
- `upgrade_required` (Boolean)
- `upgrade_suggested` (Boolean)
- `version` (String)


2 changes: 0 additions & 2 deletions docs/data-sources/polling_tentacle_deployment_targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,5 +181,3 @@ Read-Only:
- `upgrade_required` (Boolean)
- `upgrade_suggested` (Boolean)
- `version` (String)


2 changes: 0 additions & 2 deletions docs/data-sources/project_groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,3 @@ Read-Only:
- `id` (String) The unique ID for this resource.
- `name` (String) The name of this resource.
- `space_id` (String) The space ID associated with this project group.


2 changes: 0 additions & 2 deletions docs/data-sources/projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,3 @@ Read-Only:

- `deployment_action` (String) The deployment action for the donor package.
- `package_reference` (String) The package reference for the donor package.


2 changes: 0 additions & 2 deletions docs/data-sources/script_modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,3 @@ Read-Only:

- `body` (String) The body of this script module.
- `syntax` (String) The syntax of the script. Valid types are `Bash`, `CSharp`, `FSharp`, `PowerShell`, or `Python`.


2 changes: 0 additions & 2 deletions docs/data-sources/service_account_oidc_identity.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,3 @@ description: |-
- `issuer` (String) OIDC issuer url
- `name` (String) Name of the user associated to this identity
- `subject` (String) OIDC subject claims


2 changes: 0 additions & 2 deletions docs/data-sources/space.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,3 @@ Provides information about an existing space.
- `slug` (String) The unique slug of this space
- `space_managers_team_members` (Set of String) A list of user IDs designated to be managers of this space.
- `space_managers_teams` (Set of String) A list of team IDs designated to be managers of this space.


2 changes: 0 additions & 2 deletions docs/data-sources/spaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,3 @@ Read-Only:
- `slug` (String) The unique slug of this space
- `space_managers_team_members` (Set of String) A list of user IDs designated to be managers of this space.
- `space_managers_teams` (Set of String) A list of team IDs designated to be managers of this space.


2 changes: 0 additions & 2 deletions docs/data-sources/ssh_connection_deployment_targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,3 @@ Read-Only:
- `upgrade_required` (Boolean)
- `upgrade_suggested` (Boolean)
- `version` (String)


2 changes: 0 additions & 2 deletions docs/data-sources/step_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,3 @@ Read-Only:
- `id` (String)
- `label` (String)
- `name` (String)


2 changes: 0 additions & 2 deletions docs/data-sources/tag_sets.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,3 @@ Read-Only:
- `name` (String) The name of this resource.
- `sort_order` (Number) The sort order associated with this resource.
- `space_id` (String) The space ID associated with this resource.


2 changes: 0 additions & 2 deletions docs/data-sources/teams.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,3 @@ Read-Only:
- `display_id_and_name` (Boolean)
- `display_name` (String)
- `id` (String)


2 changes: 0 additions & 2 deletions docs/data-sources/tenant_projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,3 @@ Read-Only:
- `id` (String) The unique ID for this resource.
- `project_id` (String) The project ID associated with this tenant.
- `tenant_id` (String) The tenant ID associated with this tenant.


2 changes: 0 additions & 2 deletions docs/data-sources/tenants.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,3 @@ Read-Only:
- `name` (String) The name of this resource.
- `space_id` (String) The space ID associated with this tenant.
- `tenant_tags` (Set of String) A list of tenant tags associated with this resource.


2 changes: 0 additions & 2 deletions docs/data-sources/user_roles.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,3 @@ Read-Only:
- `space_permission_descriptions` (List of String)
- `supported_restrictions` (List of String)
- `system_permission_descriptions` (List of String)


2 changes: 0 additions & 2 deletions docs/data-sources/users.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,3 @@ Required:
Optional:

- `is_identifying_claim` (Boolean) Specifies whether or not the claim is an identifying claim.


2 changes: 0 additions & 2 deletions docs/data-sources/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,3 @@ Read-Only:

- `display_name` (String) The display name for the select value
- `value` (String) The select value


2 changes: 0 additions & 2 deletions docs/data-sources/worker_pools.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,3 @@ Read-Only:
- `space_id` (String)
- `worker_pool_type` (String)
- `worker_type` (String)


2 changes: 0 additions & 2 deletions docs/data-sources/workers.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,3 @@ Read-Only:
- `thumbprint` (String)
- `uri` (String)
- `worker_pool_ids` (List of String)


2 changes: 0 additions & 2 deletions docs/resources/aws_openid_connect_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,3 @@ This resource manages AWS OIDC accounts in Octopus Deploy.
### Read-Only

- `id` (String) The ID of this resource.


67 changes: 67 additions & 0 deletions docs/resources/deployment_freeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "octopusdeploy_deployment_freeze Resource - terraform-provider-octopusdeploy"
subcategory: ""
description: |-

---

# octopusdeploy_deployment_freeze (Resource)



## Example Usage

```terraform
# basic freeze with no project scopes
resource "octopusdeploy_deployment_freeze" "freeze" {
name = "Xmas"
start = "2024-12-25T00:00:00+10:00"
end = "2024-12-27T00:00:00+08:00"
}

# Freeze with different timezones and single project/environment scope
resource "octopusdeploy_deployment_freeze" "freeze" {
name = "Xmas"
start = "2024-12-25T00:00:00+10:00"
end = "2024-12-27T00:00:00+08:00"
}

resource "octopusdeploy_deployment_freeze_project" "project_freeze" {
deploymentfreeze_id= octopusdeploy_deployment_freeze.freeze.id
project_id = "Projects-123"
environment_ids = [ "Environments-123", "Environments-456" ]
}

# Freeze with ids sourced from resources and datasources. Projects can be sourced from different spaces, a single scope can only reference projects and environments from the same space.
resource "octopusdeploy_deployment_freeze" "freeze" {
name = "End of financial year shutdown"
start = "2025-06-30T00:00:00+10:00"
end = "2025-07-02T00:00:00+10:00"
}

resource "octopusdeploy_deployment_freeze_project" "project_freeze" {
deploymentfreeze_id = octopusdeploy_deployment_freeze.freeze.id
project_id = resource.octopusdeploy_project.project1.id
environment_ids = [resource.octopusdeploy_environment.production.id]
}

resource "octopusdeploy_deployment_freeze_project" "project_freeze" {
deploymentfreeze_id = octopusdeploy_deployment_freeze.freeze.id
project_id = data.octopusdeploy_projects.second_project.projects[0].id
environment_ids = [ data.octopusdeploy_environments.default_environment.environments[0].id ]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `end` (String) The end time of the freeze, must be RFC3339 format
- `name` (String) The name of this resource.
- `start` (String) The start time of the freeze, must be RFC3339 format

### Read-Only

- `id` (String) The unique ID for this resource.
29 changes: 29 additions & 0 deletions docs/resources/deployment_freeze_project.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "octopusdeploy_deployment_freeze_project Resource - terraform-provider-octopusdeploy"
subcategory: ""
description: |-

---

# octopusdeploy_deployment_freeze_project (Resource)





<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `deploymentfreeze_id` (String) The deployment freeze ID associated with this freeze scope.
- `project_id` (String) The project ID associated with this freeze scope.

### Optional

- `environment_ids` (List of String) The environment IDs associated with this project deployment freeze scope.

### Read-Only

- `id` (String) The unique ID for this resource.
2 changes: 0 additions & 2 deletions docs/resources/git_credential.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@ Manages a Git credential in Octopus Deploy.
### Read-Only

- `id` (String) The unique ID for this resource.


2 changes: 0 additions & 2 deletions docs/resources/library_variable_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,3 @@ Optional:
Read-Only:

- `id` (String) The unique ID for this resource.


2 changes: 0 additions & 2 deletions docs/resources/machine_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,3 @@ Optional:
- `kubernetes_agent_update_behavior` (String) The behaviour of how Kubernetes agent machines are updated. Valid values are `NeverUpdate` and `Update`.
- `tentacle_update_account_id` (String) The Account ID to perform any Tentacle updates under.
- `tentacle_update_behavior` (String) The behaviour of how Tentacle machines are updated. Valid values are `NeverUpdate` and `Update`.


2 changes: 0 additions & 2 deletions docs/resources/machine_proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@ This resource manages machine proxies in Octopus Deploy.
### Read-Only

- `id` (String) The unique ID for this resource.


2 changes: 0 additions & 2 deletions docs/resources/polling_subscription_id.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,3 @@ resource "octopusdeploy_kubernetes_agent_deployment_target" "agent" {

- `id` (String) The generated polling subscription ID.
- `polling_uri` (String) The URI of the polling subscription ID.


Loading
Loading