Skip to content

Commit b7afe57

Browse files
authored
Merge pull request #2 from terraform-do-modules/internal-424
fix: update source of labels module and readme.yml file
2 parents aacc27f + 5dd2473 commit b7afe57

File tree

5 files changed

+29
-36
lines changed

5 files changed

+29
-36
lines changed

README.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ badges:
2424

2525
# description of this project
2626
description: |-
27-
spaces are virtual networks containing resources that can communicate with each other in full isolation, using private IP addresses.
28-
27+
Terraform module to create Digitalocean spaces service resource on Digitalocean.
2928
# extra content
3029
include:
3130
- "terraform.md"
@@ -38,7 +37,7 @@ usage : |-
3837
```hcl
3938
module "spaces" {
4039
source = "terraform-do-modules/spaces/digitalocean"
41-
version = "0.15.0"
40+
version = "1.0.0"
4241
name = "spaces"
4342
environment = "test"
4443
acl = "private"
@@ -50,7 +49,7 @@ usage : |-
5049
```hcl
5150
module "spaces" {
5251
source = "terraform-do-modules/spaces/digitalocean"
53-
version = "0.15.0"
52+
version = "1.0.0"
5453
name = "spaces"
5554
environment = "test"
5655
acl = "private"

_examples/basic/example.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
provider "digitalocean" {
2-
spaces_access_id = "xxxxxxxxxxxxxxxxxxxx"
3-
spaces_secret_key = "xxxxxxxxxxxxxxxxxxxx"
42
}
53

64
##------------------------------------------------

_examples/complete/example.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
provider "digitalocean" {
2-
spaces_access_id = "xxxxxxxxxxxxxxxxxxxx"
3-
spaces_secret_key = "xxxxxxxxxxxxxxxxxxxx"
42
}
53

64
##------------------------------------------------

main.tf

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,26 @@
22
## Labels module callled that will be used for naming and tags.
33
##-----------------------------------------------------------------------------
44
module "labels" {
5-
source = "git::https://github.com/terraform-do-modules/terraform-digitalocean-labels.git?ref=internal-426m"
5+
source = "terraform-do-modules/labels/digitalocean"
6+
version = "1.0.0"
67
name = var.name
78
environment = var.environment
89
managedby = var.managedby
910
label_order = var.label_order
1011
}
1112

12-
#Module : Spaces
13-
#Description : Provides a bucket resource for Spaces, DigitalOcean's object storage product.
14-
13+
##-----------------------------------------------------------------------------
14+
##Description : Provides a bucket resource for Spaces, DigitalOcean's object storage product.
15+
##-----------------------------------------------------------------------------
1516
resource "digitalocean_spaces_bucket" "spaces" {
16-
count = var.enabled ? 1 : 0
17-
name = module.labels.id
18-
region = var.region
19-
acl = var.acl
20-
17+
count = var.enabled ? 1 : 0
18+
name = module.labels.id
19+
region = var.region
20+
acl = var.acl
2121
force_destroy = var.force_destroy
2222

2323
dynamic "cors_rule" {
2424
for_each = var.cors_rule == null ? [] : var.cors_rule
25-
2625
content {
2726
allowed_headers = cors_rule.value.allowed_headers
2827
allowed_methods = cors_rule.value.allowed_methods
@@ -41,9 +40,8 @@ resource "digitalocean_spaces_bucket" "spaces" {
4140
dynamic "expiration" {
4241
for_each = var.expiration
4342
content {
44-
date = lookup(expiration.value, "date", null)
45-
days = lookup(expiration.value, "days", null)
46-
43+
date = lookup(expiration.value, "date", null)
44+
days = lookup(expiration.value, "days", null)
4745
expired_object_delete_marker = lookup(expiration.value, "expired_object_delete_marker", false)
4846
}
4947
}
@@ -52,19 +50,17 @@ resource "digitalocean_spaces_bucket" "spaces" {
5250
}
5351
}
5452
}
55-
5653
versioning {
5754
enabled = var.versioning
5855
}
59-
6056
}
6157

62-
58+
##-----------------------------------------------------------------------------
59+
#Description : The digitalocean_spaces_bucket_policy resource allows Terraform to attach bucket policy to Spaces.
60+
##-----------------------------------------------------------------------------
6361
resource "digitalocean_spaces_bucket_policy" "foobar" {
64-
count = var.enabled && var.policy != null ? 1 : 0
65-
62+
count = var.enabled && var.policy != null ? 1 : 0
6663
region = join("", digitalocean_spaces_bucket.spaces[*].region)
6764
bucket = join("", digitalocean_spaces_bucket.spaces[*].name)
6865
policy = var.policy
6966
}
70-

variables.tf

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ variable "region" {
3333
#Module : spaces
3434
#Description : Provides a bucket resource for Spaces, DigitalOcean's object storage product.
3535

36-
3736
variable "acl" {
3837
type = string
3938
default = null
@@ -64,23 +63,26 @@ variable "cors_rule" {
6463
description = "CORS Configuration specification for this bucket"
6564
}
6665

67-
6866
variable "lifecycle_rule" {
69-
type = list(any)
70-
default = []
67+
type = list(any)
68+
default = []
69+
description = "A configuration of object lifecycle management (documented below)."
7170
}
71+
7272
variable "expiration" {
73-
type = list(any)
74-
default = []
73+
type = list(any)
74+
default = []
75+
description = "Specifies a time period after which applicable objects expire (documented below)."
7576
}
7677

7778
variable "policy" {
78-
type = any
79-
default = null
79+
type = any
80+
default = null
81+
description = "The text of the policy."
8082
}
8183

8284
variable "enabled" {
8385
type = bool
8486
default = true
8587
description = "Whether to create the resources. Set to `false` to prevent the module from creating any resources."
86-
}
88+
}

0 commit comments

Comments
 (0)