Skip to content

Commit

Permalink
Merge pull request #4 from avisi-cloud/renovate/github.com-avisi-clou…
Browse files Browse the repository at this point in the history
…d-go-client-0.x

Update module github.com/avisi-cloud/go-client to v0.2.0
  • Loading branch information
thojkooi authored Oct 17, 2023
2 parents c6ac75d + 74fe7a5 commit 175a966
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 43 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ bin

.idea

terraform.tfvars

*/.terraform.lock.hcl

# Created by https://www.toptal.com/developers/gitignore/api/go,terraform
Expand Down
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,13 @@
## Description
The terraform-provider-acloud is a custom Terraform provider that allows you to manage resources for Avisi Cloud.

## Installation
To use this provider, follow these steps:

Download the latest release from the [Releases page](https://github.com/avisi-cloud/terraform-provider-acloud/releases).
Extract the binary for your platform.
Place the binary in a directory included in your system's PATH.
Verify the installation by running terraform init in a Terraform configuration that references this provider.

## Usage

```terraform
terraform {
required_providers {
acloud = {
version = "v0.1.1"
version = "0.1"
source = "avisi-cloud/acloud"
}
}
Expand Down Expand Up @@ -78,4 +70,5 @@ resource "acloud_nodepool" "staging_nodepool" {
```

## License

[Apache 2.0 License 2.0](lICENSE)
2 changes: 1 addition & 1 deletion acloud/data_source_cloud_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func dataCloudAccountRead(ctx context.Context, d *schema.ResourceData, m interfa
displayName := d.Get("display_name").(string)
cloudProvider := d.Get("cloud_provider").(string)

cloudAccount, err := client.GetCloudAccount(ctx, org, displayName, cloudProvider)
cloudAccount, err := client.FindCloudAccountByName(ctx, org, displayName, cloudProvider)
if err != nil {
return diag.FromErr(err)
}
Expand Down
58 changes: 28 additions & 30 deletions examples/main.tf
Original file line number Diff line number Diff line change
@@ -1,66 +1,64 @@
terraform {
required_providers {
acloud = {
version = "v0.1.1"
version = "0.1"
source = "avisi-cloud/acloud"
}
}
}

provider "acloud" {}
variable "acloud_token" {
}

variable "organisation_slug" {
}

variable "environment_slug" {
}

provider "acloud" {
token = var.acloud_token
}

data "acloud_cloud_account" "demo_aws-cloud-account" {
organisation = "demo"
display_name = "staging"
data "acloud_cloud_account" "demo" {
organisation = var.organisation_slug
display_name = "demo"
cloud_provider = "aws"
}

resource "acloud_environment" "demo_terraform-test" {
resource "acloud_environment" "demo" {
name = "terraform-test"
type = "demo"
organisation = "demo"
organisation = var.organisation_slug
description = "terraform test"
}

resource "acloud_cluster" "demo_cluster" {
name = "tf-demo-cluster"
organisation_slug = acloud_environment.demo_terraform-test.organisation
environment_slug = acloud_environment.demo_terraform-test.slug
organisation_slug = var.organisation_slug
environment_slug = acloud_environment.demo.slug
version = "v1.26.9-u-ame.3"
region = "eu-west-1"
cloud_account_identity = data.acloud_cloud_account.demo_aws-cloud-account.identity
cloud_account_identity = data.acloud_cloud_account.demo.identity
}

resource "acloud_nodepool" "demo-update" {
organisation_slug = acloud_environment.demo_terraform-test.organisation
environment_slug = acloud_environment.demo_terraform-test.slug
resource "acloud_nodepool" "workers" {
organisation_slug = var.organisation_slug
environment_slug = acloud_environment.demo.slug
cluster_slug = acloud_cluster.demo_cluster.slug
name = "workers1"
name = "workers"
node_size = "t3.small"
min_size = 1
max_size = 1
annotations = {
"myannotation" = "test"

}

labels = {
"role" = "worker"
}

taints {
key = "mytaint"
value = "true"
effect = "NoExecute"
}

taints {
key = "mysecondtaint"
value = "true"
effect = "NoSchedule"
}

}

output "identity" {
value = data.acloud_cloud_account.demo_aws-cloud-account.identity
output "cloud_account_identity" {
value = data.acloud_cloud_account.demo.identity
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/avisi-cloud/terraform-proivder-acloud
go 1.21

require (
github.com/avisi-cloud/go-client v0.1.1
github.com/avisi-cloud/go-client v0.2.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.28.0
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki
github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec=
github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw=
github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo=
github.com/avisi-cloud/go-client v0.1.1 h1:9W3Ujl6/kW0Ka4GXuM3LiXsoSzDMg3C3Eqo2W0rJF0U=
github.com/avisi-cloud/go-client v0.1.1/go.mod h1:scsRDen1uE9usIfareBJqSMEmgfea3Ve/byhpIleavQ=
github.com/avisi-cloud/go-client v0.2.0 h1:qsv5f70TPZn3KzNMfcOXLqSspG+Y1wSHDZ+clWlfvPI=
github.com/avisi-cloud/go-client v0.2.0/go.mod h1:scsRDen1uE9usIfareBJqSMEmgfea3Ve/byhpIleavQ=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
Expand Down

0 comments on commit 175a966

Please sign in to comment.