Skip to content

Commit

Permalink
Merge branch 'master' into snapshots-deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
ismirlia authored Oct 4, 2024
2 parents 68a3f90 + b4249cb commit 2e2fecc
Show file tree
Hide file tree
Showing 145 changed files with 4,698 additions and 1,176 deletions.
2 changes: 2 additions & 0 deletions .github/labeler-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ service/Classic Infrastructure:
- '((\*|-) ?`?|(data|resource) "?)(ibm_compute|ibm_cdn|ibm_firewall|ibm_lb|ibm_lbaas|ibm_network|ibm_storage|ibm_security|ibm_subnet|ibm_hardware|ibm_ipsec)'
service/Cloud Databases:
- '((\*|-) ?`?|(data|resource) "?)ibm_(cloudant|database)'
service/Cloud Logs:
- '((\*|-) ?`?|(data|resource) "?)ibm_logs_'
service/Cloud Foundry:
- '((\*|-) ?`?|(data|resource) "?)(ibm_account|ibm_org|ibm_space|ibm_service|ibm_app_domain_private|ibm_app_domain_shared|ibm_app_route)'
service/CBR:
Expand Down
41 changes: 41 additions & 0 deletions examples/ibm-cos-bucket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,36 @@ resource ibm_cos_bucket_website_configuration "website_configuration" {
}
}
```
## ibm_cos_bucket_lifecycle_configuration

Provides an independent resource to manage the lifecycle configuration for a bucket.For more information please refer to [`ibm_cos_bucket_lifecycle_configuration`](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/ibm_cos_bucket_lifecycle_configuration)

## Example usage

```terraform
resource "ibm_cos_bucket" "cos_bucket" {
bucket_name = var.bucket_name
resource_instance_id = ibm_resource_instance.cos_instance.id
region_location = var.regional_loc
storage_class = var.standard_storage_class
}
resource "ibm_cos_bucket_lifecycle_configuration" "lifecycle" {
bucket_crn = ibm_cos_bucket.cos_bucket.crn
bucket_location = ibm_cos_bucket.cos_bucket.region_location
lifecycle_rule {
expiration{
days = 1
}
filter {
prefix = "foo"
}
rule_id = "id"
status = "enable"
}
}
```
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

## Requirements
Expand Down Expand Up @@ -582,4 +612,15 @@ resource ibm_cos_bucket_website_configuration "website_configuration" {
| http_redirect_code | HTTP redirect code to use on the response. | `string` | No
| replace_key_with | Specific object key to use in the redirect request. | `string` | No
| replace_key_prefix_with | Object key prefix to use in the redirect request. | `string` | No
| days | Days after which the lifecycle rule expiration will be applied on the object. | `int` | No
| date | Date after which the lifecycle rule expiration will be applied on the object. | `int` | No
| expire_object_delete_marker | Indicates whether ibm will remove a delete marker with no noncurrent versions. | `bool` | No
| days | Days after which the lifecycle rule transition will be applied on the object. | `int` | No
| date | Date after which the lifecycle rule transition will be applied on the object. | `int` | No
| storage_class | Class of storage used to store the object. | `string` | No
| noncurrent_days | Number of days an object is noncurrent before lifecycle action is performed. | `int` | No
| days_after_initiatiob | Number of days after which incomplete multipart uploads are aborted. | `int` | No
| id | Unique identifier for lifecycle rule. | `int` | Yes
| status | Whether the rule is currently being applied. | `int` | Yes

{: caption="inputs"}
149 changes: 146 additions & 3 deletions examples/ibm-cos-bucket/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ resource "ibm_kms_key" "key" {
force_delete = true
}

resource "ibm_cos_bucket" "hpcs-enabled" {
resource "ibm_cos_bucket" "hpcs-enable" {
depends_on = [ibm_iam_authorization_policy.policy2]
bucket_name = var.bucket_name
resource_instance_id = ibm_resource_instance.cos_instance.id
Expand All @@ -307,7 +307,7 @@ resource "ibm_cos_bucket" "hpcs-enabled" {
}

//HPCS - UKO plan
resource "ibm_cos_bucket" "hpcs-uko-enabled" {
resource "ibm_cos_bucket" "hpcs-uko-enable" {
depends_on = [ibm_iam_authorization_policy.policy2]
bucket_name = var.bucket_name
resource_instance_id = ibm_resource_instance.cos_instance.id
Expand Down Expand Up @@ -386,7 +386,7 @@ resource ibm_cos_bucket_object_lock_configuration "objectlock" {
bucket_crn = ibm_cos_bucket.bucket.crn
bucket_location = var.regional_loc
object_lock_configuration{
object_lock_enabled = "Enabled"
object_lock_enable = "Enabled"
object_lock_rule{
default_retention{
mode = "COMPLIANCE"
Expand Down Expand Up @@ -500,3 +500,146 @@ resource ibm_cos_bucket_website_configuration "website_configuration" {
EOF
}
}


#COS Lifecycle Configuration

# Adding lifecycle configuration with expiration and prefix filter.

resource "ibm_cos_bucket" "cos_bucket_lifecycle_expiration" {
bucket_name = var.bucket_name
resource_instance_id = ibm_resource_instance.cos_instance.id
region_location = var.regional_loc
storage_class = var.standard_storage_class

}
resource "ibm_cos_bucket_lifecycle_configuration" "lifecycle" {
bucket_crn = ibm_cos_bucket.cos_bucket.crn
bucket_location = ibm_cos_bucket.cos_bucket.region_location
lifecycle_rule {
expiration{
days = 1
}
filter {
prefix = "foo"
}
rule_id = "id"
status = "enable"

}
}



# Adding lifecycle configuration with transition.

resource "ibm_cos_bucket" "cos_bucket_transition" {
bucket_name = var.bucket_name
resource_instance_id = ibm_resource_instance.cos_instance.id
region_location = var.regional_loc
storage_class = var.standard_storage_class

}
resource "ibm_cos_bucket_lifecycle_configuration" "lifecycle_transition" {
bucket_crn = ibm_cos_bucket.cos_bucket.crn
bucket_location = ibm_cos_bucket.cos_bucket.region_location
lifecycle_rule {
transition{
days = 1
storage_class = "GLACIER"
}
filter {
prefix = ""
}
rule_id = "id"
status = "enable"

}
}


# Adding lifecycle configuration with abort incomplete multipart upload.

resource "ibm_cos_bucket" "cos_bucket_abort_incomplete" {
bucket_name = var.bucket_name
resource_instance_id = ibm_resource_instance.cos_instance.id
region_location = var.regional_loc
storage_class = var.standard_storage_class

}
resource "ibm_cos_bucket_lifecycle_configuration" "lifecycle_abort_incomplete" {
bucket_crn = ibm_cos_bucket.cos_bucket.crn
bucket_location = ibm_cos_bucket.cos_bucket.region_location
lifecycle_rule {
abort_incomplete_multipart_upload{
days_after_initiation = 1
}
filter {
prefix = ""
}
rule_id = "id"
status = "enable"

}
}


# Adding lifecycle configuration with non current version expiration.

resource "ibm_cos_bucket" "cos_bucket_lifecycle_version_expiration" {
bucket_name = var.bucket_name
resource_instance_id = ibm_resource_instance.cos_instance.id
region_location = var.regional_loc
storage_class = var.standard_storage_class

}
resource "ibm_cos_bucket_lifecycle_configuration" "lifecycle_new" {
bucket_crn = ibm_cos_bucket.cos_bucket.crn
bucket_location = ibm_cos_bucket.cos_bucket.region_location
lifecycle_rule {
noncurrent_version_expiration{
noncurrent_days = "1"
}
filter {
prefix = ""
}
rule_id = "id"
status = "enable"

}
}

# Adding lifecycle configuration with multiple rules

resource "ibm_cos_bucket" "cos_bucket_lifecycle" {
bucket_name = var.bucket_name
resource_instance_id = ibm_resource_instance.cos_instance.id
region_location = var.regional_loc
storage_class = var.standard_storage_class
}

resource "ibm_cos_bucket_lifecycle_configuration" "lifecycle_config" {
bucket_crn = ibm_cos_bucket.cos_bucket.crn
bucket_location = ibm_cos_bucket.cos_bucket.region_location
lifecycle_rule {
expiration{
days = 1
}
filter {
prefix = "foo"
}
rule_id = "id"
status = "enable"
}
lifecycle_rule {
expiration{
days = 2
}
filter {
prefix = "bar"
}
rule_id = "id2"
status = "enable"
}
}

10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.22.4
toolchain go1.22.5

require (
github.com/IBM-Cloud/bluemix-go v0.0.0-20240719075425-078fcb3a55be
github.com/IBM-Cloud/bluemix-go v0.0.0-20240926024252-81b3928fd062
github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20240725064144-454a2ae23113
github.com/IBM-Cloud/power-go-client v1.8.1
github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca
Expand All @@ -15,12 +15,12 @@ require (
github.com/IBM/cloudant-go-sdk v0.8.0
github.com/IBM/code-engine-go-sdk v0.0.0-20240808131715-b9d168602dac
github.com/IBM/container-registry-go-sdk v1.1.0
github.com/IBM/continuous-delivery-go-sdk v1.6.0
github.com/IBM/continuous-delivery-go-sdk v1.8.1
github.com/IBM/event-notifications-go-admin-sdk v0.9.0
github.com/IBM/eventstreams-go-sdk v1.4.0
github.com/IBM/go-sdk-core v1.1.0
github.com/IBM/go-sdk-core/v3 v3.2.4
github.com/IBM/go-sdk-core/v5 v5.17.4
github.com/IBM/go-sdk-core/v5 v5.17.5
github.com/IBM/ibm-cos-sdk-go v1.10.3
github.com/IBM/ibm-cos-sdk-go-config/v2 v2.1.0
github.com/IBM/ibm-hpcs-tke-sdk v0.0.0-20211109141421-a4b61b05f7d1
Expand All @@ -30,13 +30,13 @@ require (
github.com/IBM/logs-router-go-sdk v1.0.5
github.com/IBM/mqcloud-go-sdk v0.1.0
github.com/IBM/networking-go-sdk v0.49.0
github.com/IBM/platform-services-go-sdk v0.68.1
github.com/IBM/platform-services-go-sdk v0.69.1
github.com/IBM/project-go-sdk v0.3.5
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5
github.com/IBM/sarama v1.41.2
github.com/IBM/scc-go-sdk/v5 v5.4.1
github.com/IBM/schematics-go-sdk v0.3.0
github.com/IBM/secrets-manager-go-sdk/v2 v2.0.6
github.com/IBM/secrets-manager-go-sdk/v2 v2.0.7
github.com/IBM/vmware-go-sdk v0.1.2
github.com/IBM/vpc-beta-go-sdk v0.6.0
github.com/IBM/vpc-go-sdk v0.58.0
Expand Down
17 changes: 10 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3
github.com/DataDog/zstd v1.4.4/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
github.com/IBM-Cloud/bluemix-go v0.0.0-20240719075425-078fcb3a55be h1:USOcBHkYQ4o/ccoEvoHinrba8NQthLJpFXnAoBY+MI4=
github.com/IBM-Cloud/bluemix-go v0.0.0-20240719075425-078fcb3a55be/go.mod h1:/7hMjdZA6fEpd/dQAOEABxKEwN0t72P3PlpEDu0Y7bE=
github.com/IBM-Cloud/bluemix-go v0.0.0-20240926024252-81b3928fd062 h1:VCFztsAnZBuzyVeOrpFEJFPiKDyx6tVOLe+p3VBsfWk=
github.com/IBM-Cloud/bluemix-go v0.0.0-20240926024252-81b3928fd062/go.mod h1:/7hMjdZA6fEpd/dQAOEABxKEwN0t72P3PlpEDu0Y7bE=
github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20240725064144-454a2ae23113 h1:f2Erqfea1dKpaTFagTJM6W/wnD3JGq/Vn9URh8nuRwk=
github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20240725064144-454a2ae23113/go.mod h1:xUQL9SGAjoZFd4GNjrjjtEpjpkgU7RFXRyHesbKTjiY=
github.com/IBM-Cloud/ibm-cloud-cli-sdk v0.5.3/go.mod h1:RiUvKuHKTBmBApDMUQzBL14pQUGKcx/IioKQPIcRQjs=
Expand All @@ -136,8 +138,8 @@ github.com/IBM/code-engine-go-sdk v0.0.0-20240808131715-b9d168602dac h1:9Y5TB9Ar
github.com/IBM/code-engine-go-sdk v0.0.0-20240808131715-b9d168602dac/go.mod h1:sy4CocPPaCiS+T1znqVdw83dkoyxSMUFxkksqahUhbY=
github.com/IBM/container-registry-go-sdk v1.1.0 h1:sYyknIod8R4RJZQqAheiduP6wbSTphE9Ag8ho28yXjc=
github.com/IBM/container-registry-go-sdk v1.1.0/go.mod h1:4TwsCnQtVfZ4Vkapy/KPvQBKFc3VOyUZYkwRU4FTPrs=
github.com/IBM/continuous-delivery-go-sdk v1.6.0 h1:eAL/jIWHrDFlWDF+Qd9Y5UN99Pr5Mjd/H/bvTbXUbz4=
github.com/IBM/continuous-delivery-go-sdk v1.6.0/go.mod h1:nZdKUnubXNLo+zo28R4Rd+TGDqiJ/xoE8WO/A3kLw1E=
github.com/IBM/continuous-delivery-go-sdk v1.8.1 h1:BWmp58XODXqAe3DRQE3I0Lnrwewf8HzXH1FVCBYlAa0=
github.com/IBM/continuous-delivery-go-sdk v1.8.1/go.mod h1:5umVUaXEoTP2ULARgXRBPcR3vWDCmKD66P6XgNqpzZk=
github.com/IBM/event-notifications-go-admin-sdk v0.9.0 h1:eaCd+GkxhNyot+8rA9WkAQdlVYrRD20LYiXjEytFO6M=
github.com/IBM/event-notifications-go-admin-sdk v0.9.0/go.mod h1:OByvqfrNVxs7G6ggv8pwQCEVw10/TBJCLh7NM3z707w=
github.com/IBM/eventstreams-go-sdk v1.4.0 h1:yS/Ns29sBOe8W2tynQmz9HTKqQZ0ckse4Py5Oy/F2rM=
Expand All @@ -152,8 +154,9 @@ github.com/IBM/go-sdk-core/v5 v5.6.3/go.mod h1:tt/B9rxLkRtglE7pvqLuYikgCXaZFL3bt
github.com/IBM/go-sdk-core/v5 v5.7.0/go.mod h1:+YbdhrjCHC84ls4MeBp+Hj4NZCni+tDAc0XQUqRO9Jc=
github.com/IBM/go-sdk-core/v5 v5.9.5/go.mod h1:YlOwV9LeuclmT/qi/LAK2AsobbAP42veV0j68/rlZsE=
github.com/IBM/go-sdk-core/v5 v5.10.2/go.mod h1:WZPFasUzsKab/2mzt29xPcfruSk5js2ywAPwW4VJjdI=
github.com/IBM/go-sdk-core/v5 v5.17.4 h1:VGb9+mRrnS2HpHZFM5hy4J6ppIWnwNrw0G+tLSgcJLc=
github.com/IBM/go-sdk-core/v5 v5.17.4/go.mod h1:KsAAI7eStAWwQa4F96MLy+whYSh39JzNjklZRbN/8ns=
github.com/IBM/go-sdk-core/v5 v5.17.5 h1:AjGC7xNee5tgDIjndekBDW5AbypdERHSgib3EZ1KNsA=
github.com/IBM/go-sdk-core/v5 v5.17.5/go.mod h1:KsAAI7eStAWwQa4F96MLy+whYSh39JzNjklZRbN/8ns=
github.com/IBM/ibm-cos-sdk-go v1.10.3 h1:YfZSLqMiCrqDPbr3r+amY2sicIXlrd+3L5pok6QRXIQ=
github.com/IBM/ibm-cos-sdk-go v1.10.3/go.mod h1:T9x7pC47DUd5jD/TMFzlvly39P6EdW5wOemA78XEo2g=
github.com/IBM/ibm-cos-sdk-go-config/v2 v2.1.0 h1:U7EmXSfv7jtugRpTpOkPUmgS/xiNKtGfKVH3BGyC1hg=
Expand All @@ -173,8 +176,8 @@ github.com/IBM/mqcloud-go-sdk v0.1.0 h1:fWt4uisg5GbbsfNmAxx5/6c5gQIPM+VrEsTtnimE
github.com/IBM/mqcloud-go-sdk v0.1.0/go.mod h1:LesMQlKHXvdks4jqQLZH7HfATY5lvTzHuwQU5+y7b2g=
github.com/IBM/networking-go-sdk v0.49.0 h1:lPS34u3C0JVrbxH+Ulua76Nwl6Frv8BEfq6LRkyvOv0=
github.com/IBM/networking-go-sdk v0.49.0/go.mod h1:G9CKbmPE8gSLjN+ABh4hIZ1bMx076enl5Eekvj6zQnA=
github.com/IBM/platform-services-go-sdk v0.68.1 h1:RXGzEmdllzSj5OzCJO7AoTeQ+cgTTNa20CrrpLQe5KQ=
github.com/IBM/platform-services-go-sdk v0.68.1/go.mod h1:6rYd3stLSnotYmZlxclw45EJPaQuLmh5f7c+Mg7rOg4=
github.com/IBM/platform-services-go-sdk v0.69.1 h1:Wb8BYVpsPIppWbOQCgF7ytm+BbSOXdWWCf9zcZ6xGA4=
github.com/IBM/platform-services-go-sdk v0.69.1/go.mod h1:ZP3zUDxR1qRdUqzFdnJOlQN0QpVYol2eOUCv4uk03Jc=
github.com/IBM/project-go-sdk v0.3.5 h1:L+YClFUa14foS0B/hOOY9n7sIdsT5/XQicnXOyJSpyM=
github.com/IBM/project-go-sdk v0.3.5/go.mod h1:FOJM9ihQV3EEAY6YigcWiTNfVCThtdY8bLC/nhQHFvo=
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5 h1:NPUhkoOCRuv3OFWt19PmwjXGGTKlvmbuPg9fUrBUNe4=
Expand All @@ -185,8 +188,8 @@ github.com/IBM/scc-go-sdk/v5 v5.4.1 h1:RXIuxOo9/hxkWyHCI69ae+KIJgSbXcAkJwTEl+fO3
github.com/IBM/scc-go-sdk/v5 v5.4.1/go.mod h1:2xQTDgNXG5QMEfQxBDKB067z+5ha6OgcaKCTcdGDAo8=
github.com/IBM/schematics-go-sdk v0.3.0 h1:Vwxw85SONflakiBsNHAfViKLyp9zJiH5/hh6SewOP5Q=
github.com/IBM/schematics-go-sdk v0.3.0/go.mod h1:Tw2OSAPdpC69AxcwoyqcYYaGTTW6YpERF9uNEU+BFRQ=
github.com/IBM/secrets-manager-go-sdk/v2 v2.0.6 h1:bF6bAdI4wDZSje6+Yx1mJxvirboxO+uMuKhzgfRCNxE=
github.com/IBM/secrets-manager-go-sdk/v2 v2.0.6/go.mod h1:XWYnbcc5vN1RnKwk/fCzfD8aZd7At/Y1/b6c+oDyliU=
github.com/IBM/secrets-manager-go-sdk/v2 v2.0.7 h1:5lKt1rHuKaAaiZtbPfsF8dgiko/gGbVgreiut3zU128=
github.com/IBM/secrets-manager-go-sdk/v2 v2.0.7/go.mod h1:RglK3v6CPe3T1myRtQCD6z+nBygXvNJwufAon0qcZok=
github.com/IBM/vmware-go-sdk v0.1.2 h1:5lKWFyInWz9e2hwGsoFTEoLa1jYkD30SReN0fQ10w9M=
github.com/IBM/vmware-go-sdk v0.1.2/go.mod h1:2UGPBJju3jiv5VKKBBm9a5L6bzF/aJdKOKAzJ7HaOjA=
github.com/IBM/vpc-beta-go-sdk v0.6.0 h1:wfM3AcW3zOM3xsRtZ+EA6+sESlGUjQ6Yf4n5QQyz4uc=
Expand Down
Loading

0 comments on commit 2e2fecc

Please sign in to comment.