terraform-provider-spot

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

README

Terraform Provider for Rackspace Spot

Usage

  1. Add a dev_overrides section in your ~/.terraformrc file as follows:
    provider_installation {
      dev_overrides {
        # Replace with your own GOBIN path. Default is $GOPATH/bin
        "ngpc.rxt.io/rackerlabs/spot" = "/home/<your-username>/go/bin"
      }
      direct {}
    }
  1. Ensure that ~/go/bin is included in your system's PATH.
  2. Run make check-versions to verify that Go and Terraform are installed.
  3. Run make install to install the provider.
  4. Refer to _examples/simple-cloudspace/main.tf for the supported syntax. You can also consult the documentation.
  5. Log on to the Rackspace Spot dashboard and create an organization or select an existing organization.
  6. While being logged in, inspect the network calls to the https://spot.rackspace.com/apis and copy the token from Authorization request header.
  7. Store the token in a local file.
  8. Set an environment variable RXTSPOT_TOKEN_FILE=/path/to/the/token/file.
  9. If you are testing in a non-production environment, set the NGPC_APISERVER environment variable.
  10. Create _examples/simple-cloudspace/terraform.tfvars with values of your organization and cloudspace_name.
  11. Run make apply command that runs terraform apply.
  12. Run make destroy to cleanup.

Adding new resources

  1. Add new data sources or resources in provider_code_spec.json.
  2. Make corresponding entries in generator_config.yml.
  3. Refer to the openapi-spec to understand the attributes supported by these resources and data sources.
  4. Run make generate to create schemas corresponding to resources and data sources. The generated files, ending with _gen.go, should not be edited manually.
  5. Run NAME=<resource-name> make scaffold-rs or scaffold-ds to scaffold code for interacting with resources and data sources.
  6. Implement the necessary functions in the scaffolded Go files, located at internal/provider/<resource-name>_resource.go.
  7. Run make install.
  8. To view detailed logs during a Terraform execution, use TF_LOG=TRACE terraform plan.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL