Skip to content

Commit

Permalink
Merge pull request #363 from philips-software/feature/blobstorepolicy
Browse files Browse the repository at this point in the history
Initial Blob Repository support
  • Loading branch information
loafoe authored Sep 7, 2023
2 parents dde5772 + 232d720 commit e946390
Show file tree
Hide file tree
Showing 13 changed files with 794 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## v0.43.1

- Function: workaround for Iron.io race condition #375

## v0.43.0

- MDM: ServiceAction data sources #327
Expand Down
35 changes: 35 additions & 0 deletions docs/data-sources/blr_bucket.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
subcategory: "Blob Repository (BLR)"
---

# hsdp_blr_bucket

Retrieve details on a Blob Repository Bucket resource

## Example Usage

```hcl
data "hsdp_blr_bucket" "store" {
name = "bucket-store-1"
}
output "bucket_id" {
value = data.hsdp_connect_mdm_bucket.store.id
}
```

## Argument Reference

The following arguments are available:

* `name` - (Required) The name of the bucket to look up

## Attribute Reference

In addition to all arguments above, the following attributes are exported:

* `id` - The ID reference of the service action (format: `Bucket/${GUID}`)
* `guid` - The GUID of the bucket
* `cdn_enabled` - CDN enabled or not
* `cache_control_age` - Cache control age settings
* `cors_config_json` - The Bucket CORS configuration in JSON
40 changes: 40 additions & 0 deletions docs/resources/blr_blob_store_policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
subcategory: "Blob Repository (BLR)"
page_title: "HSDP: hsdp_blr_blob_store_policy"
description: |-
Manages HSDP Connect Blob Store Repository Policies
---

# hsdp_blr_blob_store_policy

Create and manage Blob Repository Policies

## Example Usage

```hcl
resource "hsdp_blr_blob_store_policy" "policy" {
statement {
effect = "Allow"
action = ["GET", "PUT", "DELETE"]
principal = ["prn:hsdp:iam:${data.hsdp_iam_org.myorg.id}:${hsdp_connect_mdm_proposition.first.guid}:User/*"]
resource = ["${hsdp_blr_bucket.store.name}/*"]
}
}
```

## Argument Reference

The following arguments are available:

* `statement` - (Required)
* `effect` - (Required, string) Effect of policy [`Allow`, `Deny`]
* `action` - (Required, list(string)) Allowed methods: [`GET`, `PUT`, `DELETE`]
* `principal` - (Required, list(string)) The principals the policy applies to
* `resource` - (Required, list(string)) The resources the policy applies to

## Attributes reference

In addition to all arguments above, the following attributes are exported:

* `id` - The ID reference of the service action (format: `BlobStorePolicy/${GUID}`)
* `guid` - The GUID of the bucket
52 changes: 52 additions & 0 deletions docs/resources/blr_bucket.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
subcategory: "Blob Repository (BLR)"
page_title: "HSDP: hsdp_blr_bucket"
description: |-
Manages HSDP Connect Blob Repository Buckets
---

# hsdp_blr_bucket

Create and manage Blob Repository Buckets

## Example Usage

```hcl
resource "hsdp_blr_bucket" "store" {
name = "bucket-store-1"
proposition_id = data.hsdp_connect_mdm_propososition.prop.id
enable_cdn = false
cors_configuration {
allowed_origins = ["https://foo.hsdp.io"]
allowed_methods = ["GET"]
expose_headers = ["X-Hsdp-Signature"]
}
}
```

## Argument Reference

The following arguments are available:

* `name` - (Required) The name of the device group
* `proposition_id` - (Required) The proposition ID where this bucket falls under
* `versioning_enabled` - (Required) Set versioning
* `enable_cdn` - (Optional) Enable CDN or not
* `enable_create_or_delete_blob_meta` - (Optional) Enables creation or deletion of Blob meta data
* `enable_hsdp_domain` - (Optional) Enable HSDP domain mapping
* `cache_control_age` - (Optional) Cache control age settings (Max: `1800`, Min: `300`, Default: `1`)
* `cors_configuration` - (Optional)
* `allowed_origins` - (Required, list(string)) List of allowed origins
* `allowed_methods` - (Required, list(string)) Allowed methods: [`GET`, `PUT`, `POST`, `DELETE`, `HEAD`]
* `max_age_seconds` - (Optional) Max age in seconds
* `expose_headers` - (Optional, list(string)) List of headers to expose

## Attributes reference

In addition to all arguments above, the following attributes are exported:

* `id` - The ID reference of the service action (format: `Bucket/${GUID}`)
* `guid` - The GUID of the bucket
2 changes: 2 additions & 0 deletions docs/resources/connect_mdm_bucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ description: |-

Create and manage MDM Bucket resources

~> This resource is deprecated. Please switch to using `hsdp_blr_bucket`.

## Example Usage

```hcl
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/philips-software/terraform-provider-hsdp

go 1.19
go 1.21

require (
github.com/cenkalti/backoff/v4 v4.2.1
Expand All @@ -18,7 +18,7 @@ require (
github.com/loafoe/easyssh-proxy/v2 v2.0.4
github.com/loafoe/ferrite v0.2.0
github.com/philips-labs/siderite v0.16.6
github.com/philips-software/go-hsdp-api v0.82.3
github.com/philips-software/go-hsdp-api v0.82.4
github.com/pkg/errors v0.9.1
github.com/robfig/cron/v3 v3.0.1
github.com/stretchr/testify v1.8.4
Expand Down
Loading

0 comments on commit e946390

Please sign in to comment.