Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
~ split storage resource to s3 & sftp (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
shubinmi authored Jun 1, 2021
1 parent cc1ee6c commit d22d6c9
Show file tree
Hide file tree
Showing 14 changed files with 525 additions and 220 deletions.
55 changes: 0 additions & 55 deletions docs/resources/gcore_storage.md

This file was deleted.

48 changes: 48 additions & 0 deletions docs/resources/gcore_storage_s3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "gcore_storage_s3 Resource - terraform-provider-gcorelabs"
subcategory: ""
description: |-
Represent s3 storage resource. https://storage.gcorelabs.com/storage/list
---

# gcore_storage_s3 (Resource)

Represent s3 storage resource. https://storage.gcorelabs.com/storage/list

## Example Usage

```terraform
provider gcore {
user_name = "test"
password = "test"
permanent_api_token="123$321" // https://support.gcorelabs.com/hc/en-us/articles/360018625617-API-tokens
ignore_creds_auth_error=true // if you want to manage storage resource only and provide permanent_api_token without user_name & password
gcore_platform = "https://api.gcdn.co"
gcore_storage_api = "https://storage.gcorelabs.com/api"
}
resource "gcore_storage_s3" "example_s3" {
name = "example"
location = "s-ed1"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- **location** (String) A location of new storage resource. One of (s-ed1, s-darz1, s-ws1)
- **name** (String) A name of new storage resource.

### Optional

- **client_id** (Number) An client id of new storage resource.
- **generated_access_key** (String) A s3 access key for new storage resource.
- **generated_endpoint** (String) A s3 entry point for new storage resource.
- **generated_secret_key** (String) A s3 secret key for new storage resource.
- **id** (String) The ID of this resource.
- **storage_id** (Number) An id of new storage resource.


52 changes: 52 additions & 0 deletions docs/resources/gcore_storage_sftp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "gcore_storage_sftp Resource - terraform-provider-gcorelabs"
subcategory: ""
description: |-
Represent sftp storage resource. https://storage.gcorelabs.com/storage/list
---

# gcore_storage_sftp (Resource)

Represent sftp storage resource. https://storage.gcorelabs.com/storage/list

## Example Usage

```terraform
provider gcore {
user_name = "test"
password = "test"
permanent_api_token="123$321" // https://support.gcorelabs.com/hc/en-us/articles/360018625617-API-tokens
ignore_creds_auth_error=true // if you want to manage storage resource only and provide permanent_api_token without user_name & password
gcore_platform = "https://api.gcdn.co"
gcore_storage_api = "https://storage.gcorelabs.com/api"
}
resource "gcore_storage_sftp" "example_sftp" {
name = "example"
location = "mia"
ssh_key_id = [199]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- **location** (String) A location of new storage resource. One of (ams, sin, fra, mia)
- **name** (String) A name of new storage resource.

### Optional

- **client_id** (Number) An client id of new storage resource.
- **generated_endpoint** (String) A sftp entry point for new storage resource.
- **generated_password** (Boolean) An auto generated sftp password for new storage resource.
- **http_expires_header_value** (String) A expires date of storage resource.
- **http_servername_alias** (String) An alias of storage resource.
- **id** (String) The ID of this resource.
- **password** (String) A sftp password for new storage resource.
- **ssh_key_id** (List of Number) An ssh keys IDs to link with new sftp storage resource only. https://storage.gcorelabs.com/ssh-key/list
- **storage_id** (Number) An id of new storage resource.


Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "gcore_storage_key Resource - terraform-provider-gcorelabs"
page_title: "gcore_storage_sftp_key Resource - terraform-provider-gcorelabs"
subcategory: ""
description: |-
Represent storage key resource. https://storage.gcorelabs.com/ssh-key/list
---

# gcore_storage_key (Resource)
# gcore_storage_sftp_key (Resource)

Represent storage key resource. https://storage.gcorelabs.com/ssh-key/list

Expand All @@ -20,7 +20,7 @@ provider gcore {
gcore_storage_api = "https://storage.gcorelabs.com/api"
}
resource "gcore_storage_key" "terraform_test_key" {
resource "gcore_storage_sftp_key" "terraform_test_key" {
name = "terraform_test_key"
key = "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tjom/BWDSUGPl+nafzlHDTYW7hdI4yZ5ew18JH4JW9jbhUFrviQzM7xlELEVf4h9lFX5QVkbPppSwg0cda3Pbv7kOdJ/MTyBlWXFCR+HAo3FXRitBqxiX1nKhXpHAZsMciLq8V6RjsNAQwdsdMFvSlVK/7XAt3FaoJoAsncM1Q9x5+3V0Ww68/eIFmb1zuUFljQJKprrX88XypNDvjYNby6vw/Pb0rwert/EnmZ+AW4OZPnTPI89ZPmVMLuayrD2cE86Z/il8b+gw3r3+1nKatmIkjn2so1d01QraTlMqVSsbxNrRFi9wrf+M7Q== [email protected]"
}
Expand Down
13 changes: 13 additions & 0 deletions examples/resources/gcore_storage_s3/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
provider gcore {
user_name = "test"
password = "test"
permanent_api_token="123$321" // https://support.gcorelabs.com/hc/en-us/articles/360018625617-API-tokens
ignore_creds_auth_error=true // if you want to manage storage resource only and provide permanent_api_token without user_name & password
gcore_platform = "https://api.gcdn.co"
gcore_storage_api = "https://storage.gcorelabs.com/api"
}

resource "gcore_storage_s3" "example_s3" {
name = "example"
location = "s-ed1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ provider gcore {
gcore_storage_api = "https://storage.gcorelabs.com/api"
}

resource "gcore_storage" "tf_example_sftp" {
name = "tf_example"
resource "gcore_storage_sftp" "example_sftp" {
name = "example"
location = "mia"
type = "sftp"
ssh_key_id = 199 // can be used for sftp type only
ssh_key_id = [199]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ provider gcore {
gcore_storage_api = "https://storage.gcorelabs.com/api"
}

resource "gcore_storage_key" "terraform_test_key" {
resource "gcore_storage_sftp_key" "terraform_test_key" {
name = "terraform_test_key"
key = "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tjom/BWDSUGPl+nafzlHDTYW7hdI4yZ5ew18JH4JW9jbhUFrviQzM7xlELEVf4h9lFX5QVkbPppSwg0cda3Pbv7kOdJ/MTyBlWXFCR+HAo3FXRitBqxiX1nKhXpHAZsMciLq8V6RjsNAQwdsdMFvSlVK/7XAt3FaoJoAsncM1Q9x5+3V0Ww68/eIFmb1zuUFljQJKprrX88XypNDvjYNby6vw/Pb0rwert/EnmZ+AW4OZPnTPI89ZPmVMLuayrD2cE86Z/il8b+gw3r3+1nKatmIkjn2so1d01QraTlMqVSsbxNrRFi9wrf+M7Q== [email protected]"
}
45 changes: 23 additions & 22 deletions gcore/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,28 +78,29 @@ func Provider() *schema.Provider {
},
},
ResourcesMap: map[string]*schema.Resource{
"gcore_volume": resourceVolume(),
"gcore_network": resourceNetwork(),
"gcore_subnet": resourceSubnet(),
"gcore_router": resourceRouter(),
"gcore_instance": resourceInstance(),
"gcore_keypair": resourceKeypair(),
"gcore_reservedfixedip": resourceReservedFixedIP(),
"gcore_floatingip": resourceFloatingIP(),
"gcore_loadbalancer": resourceLoadBalancer(),
"gcore_lblistener": resourceLbListener(),
"gcore_lbpool": resourceLBPool(),
"gcore_lbmember": resourceLBMember(),
"gcore_securitygroup": resourceSecurityGroup(),
"gcore_baremetal": resourceBmInstance(),
"gcore_snapshot": resourceSnapshot(),
"gcore_servergroup": resourceServerGroup(),
"gcore_storage": resourceStorage(),
"gcore_storage_key": resourceStorageKey(),
"gcore_cdn_resource": resourceCDNResource(),
"gcore_cdn_origingroup": resourceCDNOriginGroup(),
"gcore_cdn_rule": resourceCDNRule(),
"gcore_cdn_sslcert": resourceCDNCert(),
"gcore_volume": resourceVolume(),
"gcore_network": resourceNetwork(),
"gcore_subnet": resourceSubnet(),
"gcore_router": resourceRouter(),
"gcore_instance": resourceInstance(),
"gcore_keypair": resourceKeypair(),
"gcore_reservedfixedip": resourceReservedFixedIP(),
"gcore_floatingip": resourceFloatingIP(),
"gcore_loadbalancer": resourceLoadBalancer(),
"gcore_lblistener": resourceLbListener(),
"gcore_lbpool": resourceLBPool(),
"gcore_lbmember": resourceLBMember(),
"gcore_securitygroup": resourceSecurityGroup(),
"gcore_baremetal": resourceBmInstance(),
"gcore_snapshot": resourceSnapshot(),
"gcore_servergroup": resourceServerGroup(),
"gcore_storage_s3": resourceStorageS3(),
"gcore_storage_sftp": resourceStorageSFTP(),
"gcore_storage_sftp_key": resourceStorageSFTPKey(),
"gcore_cdn_resource": resourceCDNResource(),
"gcore_cdn_origingroup": resourceCDNOriginGroup(),
"gcore_cdn_rule": resourceCDNRule(),
"gcore_cdn_sslcert": resourceCDNCert(),
},
DataSourcesMap: map[string]*schema.Resource{
"gcore_project": dataSourceProject(),
Expand Down
Loading

0 comments on commit d22d6c9

Please sign in to comment.