Coder Social home page Coder Social logo

selectel / terraform-provider-selectel Goto Github PK

View Code? Open in Web Editor NEW
42.0 17.0 30.0 11.88 MB

Terraform Selectel provider

Home Page: https://www.terraform.io/docs/providers/selectel/

License: Mozilla Public License 2.0

Makefile 0.17% Go 98.41% Shell 0.13% HTML 1.28%
terraform-provider terraform selectel

terraform-provider-selectel's Introduction

Terraform Selectel Provider

Terraform Selectel Provider

Maintainers

This provider plugin is maintained by:

Requirements

  • Terraform 0.12.x
  • Go 1.21 (to build the provider plugin)

Building The Provider

Clone the repository

$ git clone [email protected]:selectel/terraform-provider-selectel.git

Enter the provider directory and build the provider

$ cd terraform-provider-selectel
$ make build

Using the provider

Getting Started with Terraform at Selectel: kb.selectel.com. Documentation is available at: docs/providers/selectel.
You can find examples in this repository: examples.
Also there are lots of examples in the selectel/terraform-examples.

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.17+ is required).

To compile the provider, run make build. This will build the provider and put the provider binary in the current directory.

$ make build

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, and often cost money to run.

$ make testacc

Releasing the Provider

This repository contains a GitHub Action configured to automatically build and publish assets for release when a tag is pushed that matches the pattern v* (ie. v0.1.0).

A Gorelaser configuration is provided that produce build artifacts matching the layout required to publish the provider in the Terraform Registry.

Releases will as drafts. Once marked as published on the GitHub Releases page, they will become available via the Terraform Registry.

terraform-provider-selectel's People

Contributors

ailurafulgens avatar antonaleks avatar appilon avatar archirk avatar cgriggs01 avatar dchudik avatar dependabot[bot] avatar dkder3k avatar dstdfx avatar gogen120 avatar gubarevich-i avatar icerzack avatar ivanromanko avatar kolsean avatar koodt avatar mbfrahry avatar milkrage avatar misterzurg avatar ozerovandrei avatar pavelpereyma avatar pr0ger avatar preved911 avatar rey-lane avatar t-sh avatar tawr1024 avatar truepack avatar vasilek15 avatar yaroslaver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terraform-provider-selectel's Issues

Fix an issue with failing Resell V2 Keypair acceptance test

While trying to execute make testacc an error occured:

=== RUN   TestAccVPCV2KeypairImportBasic
    TestAccVPCV2KeypairImportBasic: testing.go:684: Step 1 error: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
        
        (map[string]string) {
        }
        
        
        (map[string]string) (len=3) {
         (string) (len=9) "regions.#": (string) (len=1) "2",
         (string) (len=18) "regions.1578250041": (string) (len=4) "ru-1",
         (string) (len=18) "regions.1814318523": (string) (len=4) "ru-3"
        }
        
--- FAIL: TestAccVPCV2KeypairImportBasic (92.36s)
FAIL

Provider renaming

This issue tracks progress on the provider renaming.

We will rename SelVPC provider to Selectel and all resources will have the following name:

selectel_vpc_subnet_v2
selectel_vpc_project_v2
...

This is needed for supporting other Selectel services apart from VPC.

MKS Cluster V1: uppercase name support

We need to add support for uppercase names in selectel_mks_cluster_v1 resource.
Currently it's kept in lowercase in the terraform state, so if we create a cluster with an uppercase name in the config, the next run of terraform plan command will report diff changes.

Fix issues with failing acceptance tests

We often get following errors in the CI acceptance test suite:

------- Stdout: -------
=== RUN   TestAccResellV2SubnetBasic
--- FAIL: TestAccResellV2SubnetBasic (60.03s)
	testing.go:527: Step 0 error: Error applying: 1 error(s) occurred:
		
		* selvpc_resell_project_v2.project_tf_acc_test_1: 1 error(s) occurred:
		
		* selvpc_resell_project_v2.project_tf_acc_test_1: [DEBUG] error creating project: Post https://api.selectel.ru/vpc/resell/v2/projects: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
FAIL

Those kind of issues blocks all other test because we don't have enough limits on the account so we're getting following errors:

------- Stdout: -------
=== RUN   TestAccResellV2ProjectBasic
--- FAIL: TestAccResellV2ProjectBasic (79.76s)
	testing.go:527: Step 3 error: Error applying: 1 error(s) occurred:
		
		* selvpc_resell_project_v2.project_tf_acc_test_1: 1 error(s) occurred:
		
		* selvpc_resell_project_v2.project_tf_acc_test_1: error updating quotas for project '8288493b3be94e54bf9f229291a7938a': selvpcclient: got the 400 error status code from the server
FAIL

Fix import of MKS Nodegroup V1 resource

When importing a nodegroup resource, terraform plan suggests updating the value of “nodes_count” in the state, while the correct value is specified in the config.
This should be fixed.

Any plans with adding data resource for domain?

Hi there,
There is resource selectel_domains_record_v1 and I have to create selectel_domains_domain_v1 for domain_id.

Is it hard to add data selectel_domains_domain_v1 to get domain id directly?

Thanks

Unify debug messages

We have several places with duplicate messages like
log.Printf("[DEBUG] Getting keypair %s", d.Id())

We need to use common functions for them to unify debug messages between different resources.

Fix selectel_vpc_keypair_v2 regions

Currently when creating selectel_vpc_keypair_v2 resource without optional regions argument, the next run of terraform plan command will report diff changes.
It should be fixed.

Fix issues with failing acceptance tests

We often get following errors in the CI acceptance test suite:

--- FAIL: TestAccMKSNodegroupV1Basic (596.04s)
13    testing_new.go:22: WARNING: destroy failed, so remote objects may still exist and be subject to billing
14    testing_new.go:22: failed to destroy: terraform failed: exit status 1
15        
16        stderr:
17        
18        Error: error deleting nodegroup 'e3b87082-9265-416c-ba6c-18d0fb951f08/7f67eae2-85c5-4eb8-9a10-25d2804829c8': mks-go: got the 409 status code from the server: {"error":{"message":"Can't perform the operation on the cluster in MAINTENANCE status"}}
19  

Does not update resources

Hello there!
When I'm trying to change project quotas it has no effect

Terraform Version

Terraform v0.12.3

  • provider.selectel v2.2.0

Affected Resource(s)

Please list the resources as a list, for example:

  • selectel_vpc_project_v2

Terraform Configuration Files

variable "vcpus" {
  default = "4"
}


provider "selectel" {
  token = "${var.sel_token}"
}

resource "selectel_vpc_project_v2" "someproject" {
  name = "someproject"

  quotas {
    resource_name = "compute_cores"
    resource_quotas {
      region = "ru-2"
      zone   = "ru-2b"
      value  = "${var.vcpus}"
    }
  }
}

Expected Behavior

Terraform has to update project quotas

Actual Behavior

Terraform reported that no changes

Acquiring state lock. This may take a few moments...
selectel_vpc_project_v2.someproject: Refreshing state... [id=xxxxxxx]

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
Releasing state lock. This may take a few moments...

Steps to Reproduce

  1. terraform appy: first run
  2. terraform apply -var vcpus=6: try to update vcpus number
  3. change vcpus variable in tf file and run terraform apply

Fix an issue with failing Resell V2 Project acceptance test

While trying to execute make testacc an error occurred:

=== RUN   TestAccVPCV2ProjectBasic
    TestAccVPCV2ProjectBasic: testing.go:684: Step 3 error: errors during apply:

        Error: error updating quotas for project 'a1eebfc8ad4f4c31a6d689a22029c88d': selvpcclient: got the 400 status code from the server: {"image_gigabytes":{"new_project_quota":1,"domain_free_quota":0,"project_used_quota":null,"zone":"","region":"ru-1","project_quota":0},"error":"cant_set_quota"}

--- FAIL: TestAccVPCV2ProjectBasic (61.51s)

Acceptance tests are failing

I guess it started after migrating to the v2 SDK.

First error logs:

cannot run Terraform provider tests: executable found at path /usr/local/bin/terraform is not terraform: located executable at /usr/local/bin/terraform, but output of `terraform version` was:

Your version of Terraform is out of date! The latest version
is 0.13.1. You can update by downloading from https://www.terraform.io/downloads.html
Terraform v0.13.0

After that I added the Terraform installation step into acceptance tests (#132) and disabled debug logging (#134) and now it's failing with logs:

cannot run Terraform provider tests: executable found at path /home/runner/work/_temp/839df762-2d41-4108-815e-916ae2727fec/terraform is not terraform: located executable at /home/runner/work/_temp/839df762-2d41-4108-815e-916ae2727fec/terraform, but output of `terraform version` was:
/home/runner/work/_temp/839df762-2d41-4108-815e-916ae2727fec/terraform-bin version
Terraform v0.13.2

Fix an issue with failing Resell V2 Token acceptance test

While trying to execute make testacc an error occured:

=== RUN   TestAccResellV2TokenAccount
--- FAIL: TestAccResellV2TokenAccount (0.23s)
    testing.go:527: Step 0 error: Error applying: 1 error(s) occurred:
        
        * selvpc_resell_token_v2.token_tf_acc_test_1: 1 error(s) occurred:
        
        * selvpc_resell_token_v2.token_tf_acc_test_1: error creating token: selvpcclient: got the 401 error status code from the server
FAIL

[PROPOSAL] Switch to Go Modules

As part of the preparation for Terraform v0.12, we would like to migrate all providers to use Go Modules. We plan to continue checking dependencies into vendor/ to remain compatible with existing tooling/CI for a period of time, however go modules will be used for management. Go Modules is the official solution for the go programming language, we understand some providers might not want this change yet, however we encourage providers to begin looking towards the switch as this is how we will be managing all Go projects in the future. Would maintainers please react with 👍 for support, or 👎 if you wish to have this provider omitted from the first wave of pull requests. If your provider is in support, we would ask that you avoid merging any pull requests that mutate the dependencies while the Go Modules PR is open (in fact a total codefreeze would be even more helpful), otherwise we will need to close that PR and re-run go mod init. Once merged, dependencies can be added or updated as follows:

$ GO111MODULE=on go get github.com/some/module@master
$ GO111MODULE=on go mod tidy
$ GO111MODULE=on go mod vendor

GO111MODULE=on might be unnecessary depending on your environment, this example will fetch a module @ master and record it in your project's go.mod and go.sum files. It's a good idea to tidy up afterward and then copy the dependencies into vendor/. To remove dependencies from your project, simply remove all usage from your codebase and run:

$ GO111MODULE=on go mody tidy
$ GO111MODULE=on go mod vendor

Thank you sincerely for all your time, contributions, and cooperation!

MKS V1: increase default timeouts

We need to increase default timeouts for selectel_mks_cluster_v1 and selectel_mks_nodegroup_v1 resources to avoid errors during long time operations.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.