Go Report | Unit tests | License |
---|---|---|
The purpose of this project is to define a set of data sources that make it easier to find the resources managed by SUSE on the different public clouds.
The provider gathers data by accessing the public instance of public-cloud-info-service managed by SUSE.
You can find more information about the resources managed by SUSE on the public clouds here:
Use this data source to get a list of image IDs matching the specified criteria.
Example use:
data "susepubliccloud_image_ids" "sles" {
cloud = "amazon"
region = "eu-central-1"
state = "active"
name_regex = "suse-sles-15-sp1-byos.*-hvm-ssd-x86_64"
}
resource "aws_instance" "control_plane" {
ami = "${data.susepubliccloud_image_ids.sles.ids[0]}"
...
}
cloud
- (Required) Name of the target cloud to use. Valid values:amazon
,google
,microsoft
andoracle
.region
- (Required) One of the known regions in the cloud framework. Use the region identifiers as the provider describes them, for exampleus-east-1
in Amazon EC2, orEast US 2
in Microsoft Azure.state
- (Defaults toactive
) State of the image. Valid values:active
,inactive
,deprecated
. Note well: thedeleted
state isn't accepted by the data source because these images would not be usable by terraform.name_regex
- (Optional) A regex string to apply to the images list returned by the remote API managed by SUSE.sort_ascending
- (Defaults tofalse
) Used to sort by publication time.
Note well: the values accepted by cloud
, region
and state
are the ones
specified here.
ids
is set to the list of images IDs, sorted by publication time according to
sort_ascending
.
This provider is published on the official terraform registry, that makes the provider installable by terraform. This is definitely the easiest way to go.
You can find more information about that by clicking on the "USE PROVIDER" button on the terraform registry page.
openSUSE and SUSE packages are being built inside of the systemsmanagement:terraform terraform-provider-susepubliccloud project on the Open Build Service.
The packages can be installed by visiting the dedicated page on software.opensuse.org.
If you wish to work on the provider, you'll need:
Note: This project uses Go Modules making it safe to work with it outside of your existing GOPATH. The instructions that follow assume a directory in your home directory outside of the standard GOPATH (i.e $HOME/development/terraform-providers/
).
Clone repository to: $HOME/development/terraform-providers/
$ mkdir -p $HOME/development/terraform-providers/; cd $HOME/development/terraform-providers/
$ git clone [email protected]:SUSE/terraform-provider-susepubliccloud
...
To compile the provider execute the following command:
$ make build
This will produce the terraform-provider-susepubliccloud
binary that can be
copied to your ~/.terraform.d/plugins/<GOOS>_<GOARCH>
directory.
More instructions about how to instead use a custom-built provider in your Terraform environment can be found here.
Unit tests can be run via:
$ make test
Unit test coverage can be seen by executing:
$ make test-coverage
Code can be linted via:
$ make lint