Skip to content

Commit 03c38db

Browse files
committed
refactor: rename secret resource to env_secret
1 parent 80603b3 commit 03c38db

File tree

12 files changed

+53
-36
lines changed

12 files changed

+53
-36
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.4.1](https://github.com/Altinity/terraform-provider-altinitycloud/compare/v0.4.0...v0.4.1)
8+
79
## [0.4.0](https://github.com/Altinity/terraform-provider-altinitycloud/compare/v0.3.1...v0.4.0)
810
### Added
911
- Support for HCloud environments [#117](https://github.com/Altinity/terraform-provider-altinitycloud/pull/117).

docs/resources/env_hcloud.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ variable "hcloud_token" {
2121
type = string
2222
}
2323
24-
resource "altinitycloud_secret" "this" {
24+
resource "altinitycloud_env_secret" "this" {
2525
pem = altinitycloud_env_certificate.this.pem
2626
value = var.hcloud_token
2727
}
@@ -31,7 +31,7 @@ resource "altinitycloud_env_hcloud" "this" {
3131
cidr = "10.136.0.0/21"
3232
network_zone = "us-west"
3333
locations = ["hil"]
34-
hcloud_token_enc = altinitycloud_secret.this.secret_value
34+
hcloud_token_enc = altinitycloud_env_secret.this.secret_value
3535
force_destroy = true
3636
3737
load_balancers = {

docs/resources/env_secret.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "altinitycloud_env_secret Resource - terraform-provider-altinitycloud"
4+
subcategory: ""
5+
description: |-
6+
Altinity.Cloud secret resource.
7+
---
8+
9+
# altinitycloud_env_secret (Resource)
10+
11+
Altinity.Cloud secret resource.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "altinitycloud_env_certificate" "this" {
17+
env_name = "acme-staging"
18+
}
19+
20+
variable "value" {
21+
type = string
22+
}
23+
24+
resource "altinitycloud_env_secret" "this" {
25+
pem = altinitycloud_env_certificate.this.pem
26+
value = var.value
27+
}
28+
```
29+
30+
<!-- schema generated by tfplugindocs -->
31+
## Schema
32+
33+
### Required
34+
35+
- `pem` (String, Sensitive)
36+
- `value` (String)
37+
38+
### Read-Only
39+
40+
- `secret_value` (String, Sensitive)

docs/resources/secret.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

examples/resources/altinitycloud_env_hcloud/public/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ variable "hcloud_token" {
66
type = string
77
}
88

9-
resource "altinitycloud_secret" "this" {
9+
resource "altinitycloud_env_secret" "this" {
1010
pem = altinitycloud_env_certificate.this.pem
1111
value = var.hcloud_token
1212
}
@@ -16,7 +16,7 @@ resource "altinitycloud_env_hcloud" "this" {
1616
cidr = "10.136.0.0/21"
1717
network_zone = "us-west"
1818
locations = ["hil"]
19-
hcloud_token_enc = altinitycloud_secret.this.secret_value
19+
hcloud_token_enc = altinitycloud_env_secret.this.secret_value
2020
force_destroy = true
2121

2222
load_balancers = {

examples/resources/altinitycloud_env_secret/resource.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ variable "value" {
66
type = string
77
}
88

9-
resource "altinitycloud_secret" "this" {
9+
resource "altinitycloud_env_secret" "this" {
1010
pem = altinitycloud_env_certificate.this.pem
1111
value = var.value
1212
}
File renamed without changes.

internal/provider/secret/resource.go renamed to internal/provider/env_secret/resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type SecretResource struct {
2626
}
2727

2828
func (r *SecretResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
29-
resp.TypeName = req.ProviderTypeName + "_secret"
29+
resp.TypeName = req.ProviderTypeName + "_env_secret"
3030
}
3131

3232
func (r *SecretResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) {

internal/provider/secret/resource_test.go renamed to internal/provider/env_secret/resource_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/hashicorp/terraform-plugin-testing/terraform"
1010
)
1111

12-
const RESOURCE_NAME = "altinitycloud_secret"
12+
const RESOURCE_NAME = "altinitycloud_env_secret"
1313
const FILE_NAME = RESOURCE_NAME + ".dummy"
1414

1515
func TestAccAltinityCloudSecret_Basic(t *testing.T) {
File renamed without changes.

0 commit comments

Comments
 (0)