-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
01b085b
commit bb02258
Showing
5 changed files
with
211 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
layout: "arukas" | ||
page_title: "Provider: Arukas" | ||
sidebar_current: "docs-arukas-index" | ||
description: |- | ||
The Arukas provider is used to interact with the resources supported by Arukas. | ||
--- | ||
|
||
# Arukas Provider | ||
|
||
The Arukas provider is used to manage [Arukas](https://arukas.io/en/) resources. | ||
|
||
Use the navigation to the left to read about the available resources. | ||
|
||
For additional details please refer to [Arukas documentation](https://arukas.io/en/category/documents-en/). | ||
|
||
## Example Usage | ||
|
||
Here is an example that will setup the following: | ||
|
||
+ A container resource using the "NGINX" image | ||
+ Instance count is 1 | ||
+ Memory size is 256Mbyte | ||
+ Expose tcp 80 port to the EndPoint | ||
+ Set environments variable with like "key1=value1" | ||
|
||
Add the below to a file called `arukas.tf` and run the `terraform` command from the same directory: | ||
|
||
```hcl | ||
provider "arukas" { | ||
token = "" | ||
secret = "" | ||
} | ||
resource "arukas_container" "foobar" { | ||
name = "terraform_for_arukas_test_foobar" | ||
image = "nginx:latest" | ||
instances = 1 | ||
memory = 256 | ||
ports = { | ||
protocol = "tcp" | ||
number = "80" | ||
} | ||
environments { | ||
key = "key1" | ||
value = "value1" | ||
} | ||
} | ||
``` | ||
|
||
You'll need to provide your Arukas API token and secret, | ||
so that Terraform can connect. If you don't want to put | ||
credentials in your configuration file, you can leave them | ||
out: | ||
|
||
``` | ||
provider "arukas" {} | ||
``` | ||
|
||
...and instead set these environment variables: | ||
|
||
- `ARUKAS_JSON_API_TOKEN` : Your Arukas API token | ||
- `ARUKAS_JSON_API_SECRET`: Your Arukas API secret | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `token` - (Required) This is the Arukas API token. It must be provided, but | ||
it can also be sourced from the `ARUKAS_JSON_API_TOKEN` environment variable. | ||
|
||
* `secret` - (Required) This is the Arukas API secret. It must be provided, but | ||
it can also be sourced from the `ARUKAS_JSON_API_SECRET` environment variable. | ||
|
||
* `api_url` - (Optional) Override Arukas API Root URL. Also taken from the `ARUKAS_JSON_API_URL` | ||
environment variable if provided. | ||
|
||
* `trace` - (Optional) The flag of Arukas API trace log. Also taken from the `ARUKAS_DEBUG` | ||
environment variable if provided. | ||
|
||
* `timeout` - (Optional) Override Arukas API timeout seconds. Also taken from the `ARUKAS_TIMEOUT` | ||
environment variable if provided. |
98 changes: 98 additions & 0 deletions
98
website/source/docs/providers/arukas/r/container.html.markdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
--- | ||
layout: "arukas" | ||
page_title: "Arukas: container" | ||
sidebar_current: "docs-arukas-resource-container" | ||
description: |- | ||
Manages Arukas Containers | ||
--- | ||
|
||
# arukas container | ||
|
||
Provides container resource. This allows container to be created, updated and deleted. | ||
|
||
For additional details please refer to [API documentation](https://arukas.io/en/documents-en/arukas-api-reference-en/#containers). | ||
|
||
## Example Usage | ||
|
||
Create a new container using the "NGINX" image. | ||
|
||
```hcl | ||
resource "arukas_container" "foobar" { | ||
name = "terraform_for_arukas_test_foobar" | ||
image = "nginx:latest" | ||
instances = 1 | ||
memory = 256 | ||
ports = { | ||
protocol = "tcp" | ||
number = "80" | ||
} | ||
environments { | ||
key = "key1" | ||
value = "value1" | ||
} | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `name` - (Required, string) The name of the container. | ||
* `image` - (Required, string) The ID of the image to back this container.It must be a public image on DockerHub. | ||
* `instances` - (Optional, int) The count of the instance. It must be between `1` and `10`. | ||
* `memory` - (Optional, int) The size of the instance RAM.It must be `256` or `512`. | ||
* `endpoint` - (Optional,string) The subdomain part of the endpoint assigned by Arukas. If it is not set, Arukas will do automatic assignment. | ||
* `ports` - (Required , block) See [Ports](#ports) below for details. | ||
* `environments` - (Required , block) See [Environments](#environments) below for details. | ||
* `cmd` - (Optional , string) The command of the container. | ||
|
||
<a id="ports"></a> | ||
### Ports | ||
|
||
`ports` is a block within the configuration that can be repeated to specify | ||
the port mappings of the container. Each `ports` block supports | ||
the following: | ||
|
||
* `protocol` - (Optional, string) Protocol that can be used over this port, defaults to `tcp`,It must be `tcp` or `udp`. | ||
* `number` - (Optional, int) Port within the container,defaults to `80`, It must be between `1` to `65535`. | ||
|
||
<a id="environments"></a> | ||
### Environments | ||
|
||
`environments` is a block within the configuration that can be repeated to specify | ||
the environment variables. Each `environments` block supports | ||
the following: | ||
|
||
* `key` - (Required, string) Key of environment variable. | ||
* `value` - (Required, string) Value of environment variable. | ||
|
||
|
||
## Attributes Reference | ||
|
||
The following attributes are exported: | ||
|
||
* `id` - The ID of the container. | ||
* `app_id` - The ID of the Arukas application to which the container belongs. | ||
* `name` - The name of the container. | ||
* `image` - The ID of the image to back this container. | ||
* `instances` - The count of the instance. | ||
* `memory` - The size of the instance RAM. | ||
* `endpoint` - The subdomain part of the endpoint assigned by Arukas. | ||
* `ports` - See [Ports](#ports) below for details. | ||
* `environments` - See [Environments](#environments) below for details. | ||
* `cmd` - The command of the container. | ||
* `port_mappings` - See [PortMappings](#port_mappings) below for details. | ||
* `endpoint_full_url` - The URL of endpoint. | ||
* `endpoint_full_hostname` - The Hostname of endpoint. | ||
|
||
<a id="port_mappings"></a> | ||
### PortMappings | ||
|
||
`port_mappings` is a block within the configuration that | ||
the port mappings of the container. Each `port_mappings` block supports | ||
the following: | ||
|
||
* `host` - The name of the host actually running the container. | ||
* `ipaddress` - The IP address of the host actually running the container. | ||
* `container_port` - Port within the container. | ||
* `service_port` - The actual port mapped to the port in the container. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<% wrap_layout :inner do %> | ||
<% content_for :sidebar do %> | ||
<div class="docs-sidebar hidden-print affix-top" role="complementary"> | ||
<ul class="nav docs-sidenav"> | ||
<li<%= sidebar_current("docs-home") %>> | ||
<a href="/docs/providers/index.html">« Documentation Home</a> | ||
</li> | ||
|
||
<li<%= sidebar_current("docs-arukas-index") %>> | ||
<a href="/docs/providers/arukas/index.html">Arukas Provider</a> | ||
</li> | ||
|
||
<li<%= sidebar_current(/^docs-arukas-resource/) %>> | ||
<a href="#">Resources</a> | ||
<ul class="nav nav-visible"> | ||
<li<%= sidebar_current("docs-arukas-resource-container") %>> | ||
<a href="/docs/providers/arukas/r/container.html">arukas_container</a> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</div> | ||
<% end %> | ||
|
||
<%= yield %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters