Skip to content

Commit 42180d3

Browse files
committed
Add published documentation
1 parent 72fea9d commit 42180d3

18 files changed

+877
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# hsdp_credentials_access
2+
3+
Gets credentials for an S3 Credentials access
4+
5+
## Example Usage
6+
7+
```hcl
8+
data "hsdp_credentials_access" "my_access" {
9+
product_key = var.product_key
10+
username = "my_iam_login"
11+
password = "MyP@ssw0rd"
12+
}
13+
```
14+
15+
```hcl
16+
output "s3_credentials" {
17+
value = data.hsdp_credentials_access.my_access.access
18+
}
19+
```
20+
21+
## Attributes Reference
22+
23+
The following attributes are exported:
24+
25+
* `access` - JSON response to access request
26+
27+
Example output:
28+
```json
29+
[
30+
{
31+
"allowed": {
32+
"resources": [
33+
"978abfcc-6327-4373-86b4-3eb4ec8cce0f/*"
34+
],
35+
"actions": [
36+
"GET",
37+
"PUT",
38+
"LIST",
39+
"DELETE",
40+
"ALL_OBJECT"
41+
]
42+
},
43+
"credentials": {
44+
"accessKey": "PV86FAKEdquKdxDeTZ4s",
45+
"secretKey": "6qqXSECRETZqlP6fhkAuiIAdQyv2pvwL5mAQyOpc",
46+
"sessionToken": "AnotherFakeSecretTokenThPRGFvODdRVUdjWGl4bzM3WERqQnZ1bDMya3JxdlNpb3FYM01MSFdDZkZRSmZ4VGZoa05qUEJrNUdzRUZ0U3BKRHo1T0g0OGZ3bXd3bWowUzVxYTFLaG9LcnB2YWxHUXZuUTdjTks5VXNQMWVVbXhyQWhvcERidzRodkxMSWh2S25CTFgwZFBTU2ppUkc1ZlJHRGlhRHo3dnNrUHFFZnFYd0o3ZWFZYTlIM1ZMUk9CZ0JjdmgzaHIyU1lOTkNmWmdudEhtN1k2eGw0dWlFVWpNY3dTVjFRQklnamlzbGNPQmJkSmgyb0IyVlZzOU9NaEtHdmFNMFVqa0M5OEs4OWxCWnY4cEs4ZGtUZVhIVngzRjB5eUtJRVFqYVlxVE9PZjNIVXREYUJtMlh2Wk1CeW1zZXgza3RZVFhpRXBKeDBNMGpWbnVwN1NQbnpGVnFQYkJOdlNaZFZZcjFRR0g5Z2V5MENEcGFPNjJyTXVrbXZOd2E5ekFvM0NuUGVZMHdtQmk5a09NcE84ZTlsb21COVIwOER6WlNVdWhPUTdEanZGcFdlTXZ5TkUzajBBZERPSUJ5c1RrYVhZUUVoMUNTWWV4SVBSSXNjVHJOS1lqVmNLTXg0N3NMN0dnU2R4eGtrQlFoNU1vVG1FeXpQcTdFWGVpVXgyM1cK",
47+
"expires": "2019-02-20T20:58:10.000",
48+
"bucket": "cf-s3-eb78633b-7833-4953-aa58-cee7d854812b"
49+
}
50+
}
51+
]
52+
```
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# hsdp_credentials_policy
2+
3+
Gets information on defined S3 Credential policies
4+
5+
> This resource is only available when `credentials_url` is set in the provider config
6+
7+
## Example Usage
8+
9+
```hcl
10+
data "hsdp_credentials_policy" "my_org_policies" {
11+
product_key = var.product_key
12+
username = "my_iam_login"
13+
password = "MyP@ssw0rd"
14+
15+
filter {
16+
managing_org = var.my_org_id
17+
}
18+
}
19+
```
20+
21+
```hcl
22+
output "s3_credential_policies_my_org" {
23+
value = data.hsdp_credentials_policy.my_org_policies.policies
24+
}
25+
```
26+
## Argument Reference
27+
28+
The following arguments are supported:
29+
* `product_key` - (Required) The product key under which to search for policies
30+
* `username` - (Optional) The IAM username to authenticate under
31+
* `password` - (Optional) The password of `username`
32+
* `filter` - (Required) The filter conditions block for selecting policies
33+
34+
### filter options
35+
* `id` - (Optional) The id (uuid) of the filter
36+
* `managing_org` - (Optional) Finds policies under `managing_org` (uuid)
37+
* `group_name` - (Optional) Find policies assigned to this group
38+
39+
## Attributes Reference
40+
41+
The following attributes are exported:
42+
43+
* `policies` - JSON array of policies found using supplied filter values
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# hsdp_iam_introspect
2+
3+
Introspects the ORG admin account in use by the provider
4+
5+
## Example Usage
6+
7+
```hcl
8+
data "hsdp_iam_introspect" "admin" {}
9+
```
10+
11+
```hcl
12+
output "admins_org" {
13+
value = data.hsdp_iam_introspect.admin.managing_organization
14+
}
15+
```
16+
17+
## Attributes Reference
18+
19+
The following attributes are exported:
20+
21+
* `managing_organization` - The managing organization of the Org admin user
22+
* `username` - The username (email) of the Org admin user
23+
* `token` - The current session token
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# hsdp_iam_permission
2+
3+
Retrieves all available permissions
4+
5+
## Example Usage
6+
7+
```hcl
8+
data "hsdp_iam_permissions" "list" {}
9+
```
10+
11+
```hcl
12+
output "all_permissions" {
13+
value = data.hsdp_iam_permissions.list.permissions
14+
}
15+
```
16+
17+
## Attributes Reference
18+
19+
The following attributes are exported:
20+
21+
* `permissions` - The list of permissions

docs/data-sources/iam_user.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Provides details of a given HSDP IAM user.
2+
3+
>Typically this resource is used to only test account. We highly recommend using the IAM Self serviceUI which HSDP provides for day to day user management tasks
4+
5+
## Example Usage
6+
7+
```hcl
8+
data "hsdp_iam_user" "john" {
9+
username = "john.doe@1e100.io"
10+
}
11+
```
12+
13+
```hcl
14+
output "johns_uuid" {
15+
value = data.hsdp_iam_user.john.uuid
16+
}
17+
```
18+
19+
## Argument Reference
20+
21+
The following arguments are supported:
22+
23+
* `username` - (Required) The username/email of the user in HSDP IAM
24+
25+
## Attributes Reference
26+
27+
The following attributes are exported:
28+
29+
* `uuid` - The UUID of the user
30+
31+
## Error conditions
32+
33+
If the user does not fall under the given organization administration lookup may fail. In that case the lookup will return the following error
34+
35+
`responseCode: 4010`

docs/index.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# HSDP Provider
2+
3+
The HSDP provider is used to interact with HSDP REST APIs to perform adminstrative configuration of platform
4+
resources.
5+
6+
## Example Usage
7+
8+
```hcl
9+
# Many variables are optional
10+
11+
variable "region" {}
12+
variable "environment" {}
13+
variable "iam_url" {}
14+
variable "idm_url" {}
15+
variable "oauth2_client_id" {}
16+
variable "oauth2_password" {}
17+
variable "org_id" {}
18+
variable "org_admin_username" {}
19+
variable "org_admin_password" {}
20+
variable "shared_key" {}
21+
variable "secret_key" {}
22+
variable "cartel_host" {}
23+
variable "cartel_token" {}
24+
variable "cartel_secret" {}
25+
variable "cartel_skip_verify" {}
26+
variable "cartel_no_tls" {}
27+
variable "retry_max"
28+
29+
30+
## Configure the HSDP Provider
31+
32+
provider "hsdp" {
33+
region = "us-east"
34+
environment = "client-test"
35+
iam_url = var.iam_url
36+
idm_url = var.idm_url
37+
oauth2_client_id = var.oauth2_client_id
38+
oauth2_password = var.oauth2_password
39+
org_id = var.org_id
40+
org_admin_username = var.org_admin_username
41+
org_admin_password = var.org_admin_password
42+
shared_key = var.shared_key
43+
secret_key = var.secret_key
44+
debug = true
45+
debug_log = "/tmp/provider.log"
46+
}
47+
```
48+
49+
## Argument Reference
50+
51+
The following arguments are supported:
52+
53+
* `region` - (Optional) The HSDP region to use [us-east, eu-west, sa1, ...]
54+
55+
* `environment` - (Optional) The HSDP environment to use within region [client-test, prod]
56+
57+
* `iam_url` - (Optional) IAM API endpoint (e.g. https://iam-client-test.us-east.philips-healthsuite.com). Auto-discovered when region and environment are specified.
58+
59+
* `idm_url` - (Optioanl) IDM API endpoint (e.g. https://idm-client-test.us-east.philips-healthsuite.com). Auto-discovered when region and environment are specified.
60+
61+
* `credentials_url` - (Optional) S3 Credenials API endpoint (e.g. https://s3creds-client-test.us-east.philips-healthsuite.com). Auto-discovered when region and environment are specified.
62+
63+
* `oauth2_client_id` - (Required) The OAuth2 client ID as provided by HSDP
64+
65+
* `oauth2_password` - (Required) The OAuth2 password as provided by HSDP
66+
67+
* `service_id` - (Optional) The service ID to use for IAM org admin operations (conflicts with: `org_admin_username`)
68+
69+
* `service_private_key` - (Optional) The service private key to use for IAM org admin operations (conflicts with: `org_admin_password`)
70+
71+
* `org_admin_username` - (Optional) Your IAM admin username.
72+
73+
* `org_admin_password` - (Optional) Your IAM admin passowrd.
74+
75+
* `org_id` - (Optional) Your IAM root ORG id as provided by HSDP
76+
77+
* `shared_key` - (Optional) The shared key as provided by HSDP. Actions which require API signing will not work if this value is missing.
78+
79+
* `secret_key` - (Optional) The secret key as provided by HSDP. Actions which require API signing will not work if this value is missing.
80+
81+
* `cartel_host` - (Optional) The cartel host as provided by HSDP. Auto-discovered when region and environment are specified.
82+
83+
* `cartel_token` - (Optional) The cartel token as provided by HSDP.
84+
85+
* `cartel_secret` - (Optional) The cartel secret as provided by HSDP.
86+
87+
* `retry_max` - (Optiona) Integer, when > 0 will use a retry-able HTTP client and retry requests when applicable.
88+
89+
* `debug` - (Optional) If set to true, outputs details on API calls
90+
91+
* `debug_log` - (Optional) If set to a path, when debug is enabled outputs details to this file
92+

docs/resources/container_host.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# hsdp_container_host
2+
Provides HSDP Container Host instances
3+
4+
> This resource is only available when the `cartel_*` keys are set in the provider config
5+
6+
## Example Usage
7+
8+
The following example provisions three (3) new container host instances
9+
10+
```hcl
11+
resource "hsdp_container_host" "zahadoom" {
12+
count = 3
13+
name = "zahadoom-${count.index}.dev"
14+
volumes = 1
15+
volume_size = 50
16+
instance_type = "t2.medium"
17+
18+
user_groups = var.user_groups
19+
security_groups = ["analytics", "tcp-8080"]
20+
21+
connection {
22+
bastion_host = var.bastion_host
23+
host = self.private_ip
24+
user = var.user
25+
private_key = var.private_key
26+
script_path = "/home/${var.user}/bootstrap.bash"
27+
}
28+
29+
provisioner "remote-exec" {
30+
inline = [
31+
"ifconfig",
32+
"docker volume create fluent-bit",
33+
"docker run -d -p 24224:24224 -v fluent-bit:/fluent-bit/etc philipssoftware/fluent-bit-out-hsdp:1.4.4"
34+
]
35+
}
36+
}
37+
```
38+
39+
## Argument Reference
40+
41+
The following arguments are supported:
42+
43+
* `name` - (Required) The container host name. Must be unique.
44+
* `instance_type` - (Optional) The EC2 instance type to use. Default `m5.large`
45+
* `instance_role` - (Optional) The role to use. Default `container-host` (other values: `vanilla`, `base`)
46+
* `volume_type` - (Optional) The EBS volume type.
47+
* `iops` - (Optional) Number of IOPs to provision.
48+
* `protect` - (Optional) Boolean when set will enable protection for container host.
49+
* `encrypt_volumes` - (Optional) When set encrypts volumes. Default is `true`
50+
* `volumes` - (Optional) Number of additional volumes to attach. Default `0`
51+
* `volume_size` - (Optional) Volume size in GB.
52+
* `security_groups` - (Optional) list(string) of Security groups to attach. Default `[]`
53+
* `user_groups` - (Optional) list(string) of User groups to attach. Default `[]`
54+
55+
56+
## Attributes Reference
57+
58+
The following attributes are exported:
59+
60+
* `id` - The instance ID
61+
* `private_ip` - The private IP address of the instance
62+
* `role` - The role of the instance.
63+
* `subnet` - The subnet the instance was provisioned in.
64+
* `vpc` - The VPC the instance was provisioned in.
65+
* `zone` - The Zone the instance was provisioned in.
66+
* `launch_time` - Timestamp when the instance was launched.
67+
* `block_devices` - The list of block devices attached to the instance.
68+
69+
## Import
70+
71+
Importing existing instances is supported but not recommended.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# hsdp_credentials_policy
2+
Provides a resource for managing HSDP S3 Credentials policies
3+
4+
> This resource is only available when `credentials_url` is set in the provider config
5+
6+
## Example Usage
7+
8+
The following example creates a new policy
9+
10+
```hcl
11+
resource "hsdp_credentials_policy" "policy1" {
12+
product_key = var.credentials_product_key
13+
14+
policy = <<POLICY
15+
{
16+
"conditions": {
17+
"managingOrganizations": [ var.org_id ],
18+
"groups": [ "PublishGroup" ]
19+
},
20+
"allowed": {
21+
"resources": [ "${var.org_id}/foo/*" ],
22+
"actions": [
23+
"GET",
24+
"PUT"
25+
]
26+
}
27+
}
28+
POLICY
29+
}
30+
```
31+
32+
## Argument Reference
33+
34+
The following arguments are supported:
35+
36+
* `product_key` - (Required) The product key (tenant) for which this policy should apply to
37+
* `policy` - (Required) The policy definition. This is a JSON string as per HSDP S3 Credentials documentation
38+
39+
40+
## Attributes Reference
41+
42+
The following attributes are exported:
43+
44+
* `id` - The ID of the policy
45+
46+
## Import
47+
48+
Importing existing policies is currently not supported

0 commit comments

Comments
 (0)