Skip to content

ShaperTools/terraform-provider-circleci

 
 

Repository files navigation

CircleCI Terraform Provider

Setup

provider "circleci" {
  token = "<CircleCI Token>" // Will fallback to CIRCLECI_TOKEN environment variable if not explicitly specified
}

Resources

circleci_project

For reference, see CircleCI's Projects and Builds Documentation.

Example Usage:

resource "circleci_project" "example" {
  vcs_type = "github"
  username = "me"
  name     = "example"
}

Argument Reference:

The following arguments are supported:

  • vcs_type (Required) - The version control system type that the project users. Can be either github or bitbucket.
  • username (Required) - The username that owns the project in the version control system.
  • name (Required) - The name of the project.

Attributes Reference

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

  • id - A string with the format <vcs_type>/<username>/<name>.

Import

Instances can be imported using the id, e.g.

terraform import circleci_project.example github/me/example

circleci_ssh_key

For reference, see CircleCI's documentation on Adding an SSH Key.

Example Usage:

resource "tls_private_key" "example_key" {
  algorithm = "RSA"
  rsa_bits  = "4096"
}

resource "circleci_ssh_key" "example_ssh_key" {
  project_id      = "${circleci_project.example.id}"
  hostname        = "example.com"
  private_key     = "${tls.private_key.example_key.private_key_pem}"
  fingerprint_md5 = "${tls.private_key.example_key.public_key_fingerprint_md5}"
}

Argument Reference:

The following arguments are supported:

  • project_id (Required) - The ID of the project (in <vcs_type>/<username>/<name> format).
  • hostname (Required) - The hostname for the key.
  • private_key (Required) - The private key to use for the given hostname.
  • fingerprint_md5 (Required) - The MD5 fingerprint of the given private_key.

Attributes Reference

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

  • id - A string with the format <vcs_type>/<username>/<name>/<hostname>/<fingerprint_md5>.

Import

The circleci_ssh_key resource does not support importing.

Building The Provider

make build

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 82.7%
  • Makefile 14.9%
  • Shell 2.4%