From 15de5c3cf9ab9e5212d557efa3923e3a0a44cd46 Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Sun, 7 Dec 2014 18:42:27 -0800 Subject: [PATCH] website: Document the atlas provider --- website/source/assets/stylesheets/_docs.scss | 1 + .../docs/providers/atlas/index.html.markdown | 40 +++++++++++ .../providers/atlas/r/artifact.html.markdown | 68 +++++++++++++++++++ .../source/docs/providers/index.html.markdown | 2 +- website/source/layouts/atlas.erb | 26 +++++++ website/source/layouts/docs.erb | 6 +- 6 files changed, 141 insertions(+), 2 deletions(-) create mode 100644 website/source/docs/providers/atlas/index.html.markdown create mode 100644 website/source/docs/providers/atlas/r/artifact.html.markdown create mode 100644 website/source/layouts/atlas.erb diff --git a/website/source/assets/stylesheets/_docs.scss b/website/source/assets/stylesheets/_docs.scss index e4733e38b..b62718944 100755 --- a/website/source/assets/stylesheets/_docs.scss +++ b/website/source/assets/stylesheets/_docs.scss @@ -6,6 +6,7 @@ body.page-sub{ background-color: $light-black; } +body.layout-atlas, body.layout-consul, body.layout-dnsimple, body.layout-cloudflare, diff --git a/website/source/docs/providers/atlas/index.html.markdown b/website/source/docs/providers/atlas/index.html.markdown new file mode 100644 index 000000000..805e26d16 --- /dev/null +++ b/website/source/docs/providers/atlas/index.html.markdown @@ -0,0 +1,40 @@ +--- +layout: "atlas" +page_title: "Provider: Atlas" +sidebar_current: "docs-atlas-index" +description: |- + The Atlas provider is used to interact with configuration, + artifacts, and metadata managed by the Atlas service. +--- + +# Atlas Provider + +The Atlas provider is used to interact with resources, configuration, +artifacts, and metadata managed by [Atlas](https://atlas.hashicorp.com). +The provider needs to be configured with the proper credentials before +it can be used. + +Use the navigation to the left to read about the available resources. + +## Example Usage + +``` +# Configure the Atlas provider +provider "atlas" { + token = "${var.atlas_token}" +} + +# Fetch an artifact configuration +resource "atlas_artifact" "web" { + ... +} +``` + +## Argument Reference + +The following arguments are supported: + +* `address` - (Optional) Atlas server endpoint. Defaults to public Atlas. + This is only required when using an on-premise deployment of Atlas. +* `token` - (Required) API token + diff --git a/website/source/docs/providers/atlas/r/artifact.html.markdown b/website/source/docs/providers/atlas/r/artifact.html.markdown new file mode 100644 index 000000000..0021c9c1d --- /dev/null +++ b/website/source/docs/providers/atlas/r/artifact.html.markdown @@ -0,0 +1,68 @@ +--- +layout: "atlas" +page_title: "Atlas: atlas_artifact" +sidebar_current: "docs-atlas-resource-artifact" +description: |- + Provides access to deployment artifacts managed by Atlas. This can + be used to dynamically configure instantiation and provisioning + of resources. +--- + +# atlas\_artifact + +Provides access to deployment artifacts managed by Atlas. This can +be used to dynamically configure instantiation and provisioning +of resources. + +## Example Usage + +``` +# Read the AMI +resource "atlas_artifact" "web" { + name = "hashicorp/web" + type = "aws.ami" + metadata { + arch = "386" + } +} + +# Start our instance with the dynamic ami value +resource "aws_instance" "app" { + ami = "${atlas_artifact.web.id}" + ... +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) Name of the artifact in Atlas. This is given + in slug format like "organization/artifact". + +* `type` - (Required) The type of artifact to query for. + +* `version` - (Optional) By default, if no version is provided the + latest version of the artifact is used. Providing a version can + be used to pin a dependency. + +* `metadata_keys` - (Optional) If given, only an artifact containing + the given keys will be returned. This is used to disambiguate when + multiple potential artifacts match. An example is "aws" to filter + on an AMI. + +* `metadata` - (Optional) If given, only an artifact matching the + metadata filters will be returned. This is used to disambiguate when + multiple potential artifacts match. An example is "arch" = "386" to + filter on architecture. + + +## Attributes Reference + +The following attributes are exported: + +* `version` - The matching version of the artifact +* `id` - The ID of the artifact. This could be an AMI ID, GCE Image ID, etc. +* `file_url` - For artifacts that are binaries, this is a download path. +* `metadata_full` - Contains the full metadata of the artifact. + diff --git a/website/source/docs/providers/index.html.markdown b/website/source/docs/providers/index.html.markdown index 457c6ceaf..f03c17c54 100644 --- a/website/source/docs/providers/index.html.markdown +++ b/website/source/docs/providers/index.html.markdown @@ -15,6 +15,6 @@ etc. Almost any infrastructure noun can be represented as a resource in Terrafor Terraform is agnostic to the underlying platforms by supporting providers. A provider is responsible for understanding API interactions and exposing resources. Providers generally are an IaaS (e.g. AWS, DigitalOcean, GCE), PaaS (e.g. Heroku, CloudFoundry), -or SaaS services (e.g. DNSimple, CloudFlare). +or SaaS services (e.g. Atlas, DNSimple, CloudFlare). Use the navigation to the left to read about the available providers. diff --git a/website/source/layouts/atlas.erb b/website/source/layouts/atlas.erb new file mode 100644 index 000000000..4a357b8e6 --- /dev/null +++ b/website/source/layouts/atlas.erb @@ -0,0 +1,26 @@ +<% wrap_layout :inner do %> + <% content_for :sidebar do %> + + <% end %> + + <%= yield %> + <% end %> diff --git a/website/source/layouts/docs.erb b/website/source/layouts/docs.erb index 7682928fb..ead92b546 100644 --- a/website/source/layouts/docs.erb +++ b/website/source/layouts/docs.erb @@ -91,7 +91,11 @@ > Providers -