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

Adding changes for F1881 #5277

Merged
merged 23 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c063304
Adding changes for f1881
IBM-diksha Apr 16, 2024
e1f7208
Adding the documentation
IBM-diksha Apr 17, 2024
dc7921a
Making changes to the documentation and test case improvement
IBM-diksha Apr 23, 2024
2e12ea2
Test case improvement
IBM-diksha Apr 23, 2024
382defd
Making corrections in existing documentation for activity tracker
IBM-diksha Apr 29, 2024
b9137c0
Making corrections in existing documentation for f1881
IBM-diksha Apr 29, 2024
cedb962
Addressing the review comments for documentation
IBM-diksha May 13, 2024
fdc6d74
Adding the example in the documentation
IBM-diksha May 13, 2024
0a688f3
Fixing the indentation
IBM-diksha May 13, 2024
6b36002
Adding changes to the description of activity_tracker_crn and metrics…
IBM-diksha May 13, 2024
cea8999
Adding changes to the description of activity_tracker_crn and metrics…
IBM-diksha May 13, 2024
c5a9999
Removingthe examples with crn and adding changes to field description
IBM-diksha May 13, 2024
b283832
Documentation changes
IBM-diksha May 14, 2024
9ee92f9
Documentation indentation changes
IBM-diksha May 14, 2024
8d151d6
Documentation indentation changes
IBM-diksha May 14, 2024
e5f772f
Documentation description changes
IBM-diksha May 14, 2024
4eae5dd
Documentation indentation fix
IBM-diksha May 14, 2024
4bbd098
Addressing the Documentation review comments
IBM-diksha May 15, 2024
780f8ba
Adding location constraint for objectlock bucket
IBM-diksha Jun 13, 2024
f6de9f7
Format issue
IBM-diksha Jun 13, 2024
3f43185
Upgrading RC go sdk to 2.1.0
IBM-diksha Jun 14, 2024
45bbd81
Merge branch 'master' into diksha/f1881-dev
IBM-diksha Jun 14, 2024
f94f2e1
Adding Fix for upgrade crn config issue
IBM-diksha Jun 14, 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
72 changes: 36 additions & 36 deletions examples/ibm-cos-bucket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,21 @@ resource "ibm_resource_instance" "metrics_monitor" {
}
}
resource "ibm_cos_bucket" "standard-ams03" {
bucket_name = var.bucket_name
resource_instance_id = ibm_resource_instance.cos_instance.id
single_site_location = "sjc04"
#cross_region_location = var.region
storage_class = var.storage
bucket_name = var.bucket_name
resource_instance_id = ibm_resource_instance.cos_instance.id
single_site_location = var.single_site_loc
storage_class = var.standard_storage_class
hard_quota = var.quota
activity_tracking {
read_data_events = true
write_data_events = true
activity_tracker_crn = ibm_resource_instance.activity_tracker.id
management_events = true
}
metrics_monitoring {
usage_metrics_enabled = true
request_metrics_enabled = true
metrics_monitoring_crn = ibm_resource_instance.metrics_monitor.id
}
allowed_ip = ["223.196.168.27","223.196.161.38","192.168.0.1"]
allowed_ip = ["223.196.168.27", "223.196.161.38", "192.168.0.1"]
}

resource "ibm_cos_bucket" "archive_expire_rule_cos" {
Expand Down Expand Up @@ -529,12 +528,13 @@ resource ibm_cos_bucket_website_configuration "website_configuration" {
| satellite_location_id | satellite location. | `string` | no |
| storage | The storage class that you want to use for the bucket. Supported values are **standard, vault, cold, flex, and smart**.| `string` | no |
| region | The location for a cross-regional bucket. Supported values are **us, eu, and ap**. | `string` | no |
| read_data_events | Enables sending log data to Activity Tracker and LogDNA to provide visibility into object read and write events. | `array` | no
| write_data_events | All object write events (i.e. uploads) will be sent to Activity Tracker. | `bool` | no
| activity_tracker_crn | Required the first time activity_tracking is configured. | `string` | yes
| usage_metrics_enabled | Specify **true or false** to set usage metrics (i.e. bytes_used). | `bool` | no
| request_metrics_enabled | Specify true or false to set cos request metrics (i.e. get, put, or post request). | `bool` | no
| metrics_monitoring_crn | Required the first time metrics_monitoring is configured. The instance of IBM Cloud Monitoring that will receive the bucket metrics. | `string` | yes
| read_data_events | If set to **true**, all object read events (i.e. downloads) will be sent to Activity Tracker. | `bool` | no
| write_data_events | If set to **true**, all object write events (i.e. uploads) will be sent to Activity Tracker. | `bool` | no
| management_events |If set to **true**, all bucket management events will be sent to Activity Tracker.This field only applies if `activity_tracker_crn` is not populated. | `bool` | no
| activity_tracker_crn |When the `activity_tracker_crn` is not populated, then enabled events are sent to the Activity Tracker instance associated to the container's location unless otherwise specified in the Activity Tracker Event Routing service configuration.If `activity_tracker_crn` is populated, then enabled events are sent to the Activity Tracker instance specified and bucket management events are always enabled. | `string` | no
| usage_metrics_enabled |If set to **true**, all usage metrics (i.e. `bytes_used`) will be sent to the monitoring service.| `bool` | no
| request_metrics_enabled | If set to **true**, all request metrics (i.e. `rest.object.head`) will be sent to the monitoring service. | `bool` | no
| metrics_monitoring_crn | When the `metrics_monitoring_crn` is not populated, then enabled metrics are sent to the monitoring instance associated to the container's location unless otherwise specified in the Metrics Router service configuration.If `metrics_monitoring_crn` is populated, then enabled events are sent to the Metrics Monitoring instance specified. | `string` | no
| regional_loc | The location for a regional bucket. Supported values are **au-syd, eu-de, eu-gb, jp-tok, us-east, or us-south**. | `string` | no
| type | Specifies the archive type to which you want the object to transition. Supported values are **Glacier or Accelerated**. | `string` |yes
| rule_id | Unique identifier for the rule. | `string` | no
Expand All @@ -553,28 +553,28 @@ resource ibm_cos_bucket_website_configuration "website_configuration" {
| object_lock | enables Object Lock on a bucket. | `bool` | no
| bucket\_crn | The CRN of the source COS bucket. | `string` | yes |
| bucket\_location | The location of the source COS bucket. | `string` | yes |
| destination_bucket_crn | The CRN of your destination bucket that you want to replicate to. | `String` | yes
| deletemarker_replication_status | Specifies whether Object storage replicates delete markers. Specify true for Enabling it or false for Disabling it. | `String` | no
| status | Specifies whether the rule is enabled. Specify true for Enabling it or false for Disabling it. | `String` | yes
| rule_id | The rule id. | `String` | no
| priority | A priority is associated with each rule. The rule will be applied in a higher priority if there are multiple rules configured. The higher the number, the higher the priority | `String` | no
| prefix | An object key name prefix that identifies the subset of objects to which the rule applies. | `String` | no
| bucket_crn | The CRN of the COS bucket on which Object Lock is enabled or should be enabled. | `String` | yes
| bucket_location | Location of the COS bucket. | `String` | yes
| endpoint_type | Endpoint types of the COS bucket. | `String` | no
| object_lock_enabled | Enable Object Lock on an existing COS bucket. | `String` | yes
| mode | Retention mode for the Object Lock configuration. | `String` | yes
| destination_bucket_crn | The CRN of your destination bucket that you want to replicate to. | `string` | yes
| deletemarker_replication_status | Specifies whether Object storage replicates delete markers. Specify true for Enabling it or false for Disabling it. | `string` | no
| status | Specifies whether the rule is enabled. Specify true for Enabling it or false for Disabling it. | `string` | yes
| rule_id | The rule id. | `string` | no
| priority | A priority is associated with each rule. The rule will be applied in a higher priority if there are multiple rules configured. The higher the number, the higher the priority | `string` | no
| prefix | An object key name prefix that identifies the subset of objects to which the rule applies. | `string` | no
| bucket_crn | The CRN of the COS bucket on which Object Lock is enabled or should be enabled. | `string` | yes
| bucket_location | Location of the COS bucket. | `string` | yes
| endpoint_type | Endpoint types of the COS bucket. | `string` | no
| object_lock_enabled | Enable Object Lock on an existing COS bucket. | `string` | yes
| mode | Retention mode for the Object Lock configuration. | `string` | yes
| years | Retention period in terms of years after which the object can be deleted. | `int` | no
| days | Retention period in terms of days after which the object can be deleted. | `int` | no
| key | Object key name to use when a 4XX class error occurs given as error document. | `String` | no
| suffix | The home or default page of the website when static web hosting configuration is added. | `String` | Yes
| hostname | Name of the host where requests are redirected. | `String` | Yes
| protocol | Protocol to use when redirecting requests. The default is the protocol that is used in the original request. | `String` | No
| http_error_code_returned_equals | HTTP error code when the redirect is applied. | `String` | No
| key_prefix_equals | Object key name prefix when the redirect is applied. | `String` | No
| host_name | Host name to use in the redirect request. | `String` | Yes
| protocol | Protocol to use when redirecting requests. | `String` | No
| 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
| key | Object key name to use when a 4XX class error occurs given as error document. | `string` | no
| suffix | The home or default page of the website when static web hosting configuration is added. | `string` | Yes
| hostname | Name of the host where requests are redirected. | `string` | Yes
| protocol | Protocol to use when redirecting requests. The default is the protocol that is used in the original request. | `string` | No
| http_error_code_returned_equals | HTTP error code when the redirect is applied. | `string` | No
| key_prefix_equals | Object key name prefix when the redirect is applied. | `string` | No
| host_name | Host name to use in the redirect request. | `string` | Yes
| protocol | Protocol to use when redirecting requests. | `string` | No
| 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
{: caption="inputs"}
3 changes: 1 addition & 2 deletions examples/ibm-cos-bucket/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ resource "ibm_cos_bucket" "standard-ams03" {
activity_tracking {
read_data_events = true
write_data_events = true
activity_tracker_crn = ibm_resource_instance.activity_tracker.id
management_events = true
}
metrics_monitoring {
usage_metrics_enabled = true
request_metrics_enabled = true
metrics_monitoring_crn = ibm_resource_instance.metrics_monitor.id
}
allowed_ip = ["223.196.168.27", "223.196.161.38", "192.168.0.1"]
}
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ require (
github.com/IBM/event-notifications-go-admin-sdk v0.6.1
github.com/IBM/eventstreams-go-sdk v1.4.0
github.com/IBM/go-sdk-core/v3 v3.2.4
github.com/IBM/go-sdk-core/v5 v5.17.2
github.com/IBM/ibm-cos-sdk-go v1.10.1
github.com/IBM/ibm-cos-sdk-go-config/v2 v2.0.4
github.com/IBM/go-sdk-core/v5 v5.17.3
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
github.com/IBM/ibm-hpcs-uko-sdk v0.0.20-beta
github.com/IBM/keyprotect-go-client v0.14.0
Expand Down
15 changes: 7 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ github.com/IBM/go-sdk-core/v5 v5.7.0/go.mod h1:+YbdhrjCHC84ls4MeBp+Hj4NZCni+tDAc
github.com/IBM/go-sdk-core/v5 v5.9.2/go.mod h1:YlOwV9LeuclmT/qi/LAK2AsobbAP42veV0j68/rlZsE=
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.2 h1:MyFCUPYqcNUQIx9d9srq9znMEZcvu6X3DOGIPjegP8o=
github.com/IBM/go-sdk-core/v5 v5.17.2/go.mod h1:GatGZpxlo1KaxiRN6E10/rNgWtUtx1hN/GoHSCaSPKA=
github.com/IBM/ibm-cos-sdk-go v1.10.1 h1:vQCsu61OHRVF2lL6ah+m3AmUlhnYGkI1qogukCEFULs=
github.com/IBM/ibm-cos-sdk-go v1.10.1/go.mod h1:zhcgfL2YG5DVaI5R2F6oYO2DYnvwW14vpcpFq+ybhXU=
github.com/IBM/ibm-cos-sdk-go-config/v2 v2.0.4 h1:fvy/cMKn/3BngdxaL5dXaSlUuzTANY42VuVQuW0NEYE=
github.com/IBM/ibm-cos-sdk-go-config/v2 v2.0.4/go.mod h1:Pam4aWm9Ve/pqAVrPW8nm2yCXq0h9LDeQ1Iacx5g9rU=
github.com/IBM/go-sdk-core/v5 v5.17.3 h1:CZSVCKzhQc/hRQZOtuEmi9dlNtWMnxJvOsPtQKP7cZ4=
github.com/IBM/go-sdk-core/v5 v5.17.3/go.mod h1:GatGZpxlo1KaxiRN6E10/rNgWtUtx1hN/GoHSCaSPKA=
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=
github.com/IBM/ibm-cos-sdk-go-config/v2 v2.1.0/go.mod h1:vMQ0DKpyoPk1MstfipPBoLfFxl3HWjzG/wH/UVg/xiU=
github.com/IBM/ibm-hpcs-tke-sdk v0.0.0-20211109141421-a4b61b05f7d1 h1:T5UwRKKd+BoaPZ7UIlpJrzXzVTUEs8HcxwQ3pCIbORs=
github.com/IBM/ibm-hpcs-tke-sdk v0.0.0-20211109141421-a4b61b05f7d1/go.mod h1:M2JyuyeWHPtgGNeezr6YqVRuaav2MpY8Ha4QrEYvMoI=
github.com/IBM/ibm-hpcs-uko-sdk v0.0.20-beta h1:P1fdIfKsD9xvJQ5MHIEztPS9yfNf9x+VDTamaYcmqcs=
Expand Down Expand Up @@ -1372,8 +1372,8 @@ github.com/onsi/gomega v1.27.7/go.mod h1:1p8OOlwo2iUUDsHnOrjE5UKYJ+e3W8eQ3qSlRah
github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJKFnNQ=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo=
github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0=
github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
Expand Down Expand Up @@ -1600,7 +1600,6 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
Expand Down
12 changes: 12 additions & 0 deletions ibm/acctest/acctest.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ var (
CloudShellAccountID string
CosCRN string
BucketCRN string
ActivityTrackerInstanceCRN string
MetricsMonitoringCRN string
BucketName string
CosName string
Ibmid1 string
Expand Down Expand Up @@ -529,6 +531,16 @@ func init() {
BucketCRN = ""
fmt.Println("[WARN] Set the environment variable IBM_COS_Bucket_CRN with a VALID BUCKET CRN for testing ibm_cos_bucket* resources")
}
ActivityTrackerInstanceCRN = os.Getenv("IBM_COS_ACTIVITY_TRACKER_CRN")
if ActivityTrackerInstanceCRN == "" {
ActivityTrackerInstanceCRN = ""
fmt.Println("[WARN] Set the environment variable IBM_COS_ACTIVITY_TRACKER_CRN with a VALID ACTIVITY TRACKER INSTANCE CRN in valid region for testing ibm_cos_bucket* resources")
}
MetricsMonitoringCRN = os.Getenv("IBM_COS_METRICS_MONITORING_CRN")
if MetricsMonitoringCRN == "" {
MetricsMonitoringCRN = ""
fmt.Println("[WARN] Set the environment variable IBM_COS_METRICS_MONITORING_CRN with a VALID METRICS MONITORING CRN for testing ibm_cos_bucket* resources")
}
BucketName = os.Getenv("IBM_COS_BUCKET_NAME")
if BucketName == "" {
BucketName = ""
Expand Down
3 changes: 3 additions & 0 deletions ibm/flex/structures.go
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,9 @@ func FlattenActivityTrack(in *resourceconfigurationv1.ActivityTracking) []interf
if in.WriteDataEvents != nil {
att["write_data_events"] = *in.WriteDataEvents
}
if in.ManagementEvents != nil {
att["management_events"] = *in.ManagementEvents
}
if in.ActivityTrackerCrn != nil {
att["activity_tracker_crn"] = *in.ActivityTrackerCrn
}
Expand Down
17 changes: 11 additions & 6 deletions ibm/service/cos/data_source_ibm_cos_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,22 @@ func DataSourceIBMCosBucket() *schema.Resource {
"read_data_events": {
Type: schema.TypeBool,
Computed: true,
Description: "If set to true, all object read events will be sent to Activity Tracker.",
Description: "If set to true, all object read events (i.e. downloads) will be sent to Activity Tracker.",
},
"write_data_events": {
Type: schema.TypeBool,
Computed: true,
Description: "If set to true, all object write events will be sent to Activity Tracker.",
Description: "If set to true, all object write events (i.e. uploads) will be sent to Activity Tracker.",
},
"management_events": {
Type: schema.TypeBool,
Computed: true,
Description: "This field only applies if `activity_tracker_crn` is not populated. If set to true, all bucket management events will be sent to Activity Tracker.",
},
"activity_tracker_crn": {
Type: schema.TypeString,
Computed: true,
Description: "The instance of Activity Tracker that will receive object event data",
Description: "When the `activity_tracker_crn` is not populated, then enabled events are sent to the Activity Tracker instance associated to the container's location unless otherwise specified in the Activity Tracker Event Routing service configuration.If `activity_tracker_crn` is populated, then enabled events are sent to the Activity Tracker instance specified and bucket management events are always enabled.",
},
},
},
Expand All @@ -149,17 +154,17 @@ func DataSourceIBMCosBucket() *schema.Resource {
"usage_metrics_enabled": {
Type: schema.TypeBool,
Computed: true,
Description: "Usage metrics will be sent to the monitoring service.",
Description: "If set to `true`, all usage metrics (i.e. `bytes_used`) will be sent to the monitoring service.",
},
"request_metrics_enabled": {
Type: schema.TypeBool,
Computed: true,
Description: "Request metrics will be sent to the monitoring service.",
Description: "If set to true, all request metrics (i.e. `rest.object.head`) will be sent to the monitoring service",
},
"metrics_monitoring_crn": {
Type: schema.TypeString,
Computed: true,
Description: "Instance of IBM Cloud Monitoring that will receive the bucket metrics.",
Description: "When the `metrics_monitoring_crn` is not populated, then enabled metrics are sent to the monitoring instance associated to the container's location unless otherwise specified in the Metrics Router service configuration.If `metrics_monitoring_crn` is populated, then enabled events are sent to the Metrics Monitoring instance specified.",
},
},
},
Expand Down
Loading
Loading