The Shorten URL provider uses a service and gives a short url for the given url.
If you are building the provider, follow the instructions to install it as a plugin. After placing it into your plugins directory, run terraform init
to initialize it.
ex.
# Configure provider with your service details
provider "urlshorten" {
# Shorten URL service's password
password = "admin123"
# it can be set using the environment variable SHORTEN_PASSWORD
# Service's name
service = "tinyurl"
# it can be set using the environment variable SHORTEN_SERVICE
}
# Retrieve project's templates
data "shorten_url" "response" {
provider = urlshorten
url = "https://www.iana.org/dnssec/archive/launch-status-updates"
}
output "shorten_url_response" {
value = data.shorten_url.response
}
In the examples directory you can find more.
Clone this repository to: $GOPATH/src/github.com/wastorga/terraform-provider-urlshorten
$ mkdir -p $GOPATH/src/github.com/wastorga
$ cd $GOPATH/src/github.com/wastorga
$ git clone https://github.com/wastorga/terraform-provider-urlshorten.git
Enter the provider directory and build the provider
$ cd $GOPATH/src/github.com/wastorga/terraform-provider-urlshorten
$ make build
If you wish to work on the provider, you'll first need Go installed
on your machine (version 1.15+ is required). You'll also need to correctly setup a
GOPATH, as well as adding $GOPATH/bin
to your $PATH
.
To compile the provider, run make build
. This will build the provider and put the provider binary
in the $GOPATH/bin
directory.
$ make build
...
$ $GOPATH/bin/terraform-provider-urlshorten
...
In order to test the provider, you can simply run make test
.
$ make test
In order to run the full suite of Acceptance tests, run make testacc
.
Note: Acceptance tests create real resources.
$ make testacc
In the docs directory you can find the documentation.
Ongoing development efforts and contributions to this provider are tracked as issues in this repository.
We welcome community contributions to this project. If you find problems, need an enhancement or need a new data-source or resource, please open an issue or create a PR against the Terraform Provider for Shorten URL repository.
This library is distributed under the license found in the LICENSE file.