Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support OpenStack provider #7

Merged

Conversation

yukirii
Copy link
Contributor

@yukirii yukirii commented May 4, 2019

This PR adds support OpenStack provider. Currently this provider supports the following resources:

Copy link
Collaborator

@sergeylanzman sergeylanzman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks you!!! good job, fast time,
Please check my comments, I don't worked with openstack, but look good
Please add "github.com/gophercloud/gophercloud" to gomod files

"openstack_compute_instance_v2",
"openstack",
map[string]string{
"name": s.Name,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


// Rename "all_metadata" to "metadata"
// because "all_metadata" field cannot be set as resource argument
for k, v := range g.Resources[i].InstanceState.Attributes {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You tested this? InstanceState.Attributes it same data from provider and from Attributes terraformer create tfstate.
I don't know if you need replace in tftstate "all_metadata" => "metadata". I see in tf this metadata, but I think in tfstate this all_metadata
https://github.com/terraform-providers/terraform-provider-openstack/blob/master/openstack/resource_openstack_compute_instance_v2.go#L597

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reconfirm the exported files of terraform-provider-openstack. I created a tf file containing "openstack_compute_instance_v2" and "metadata" field. As a result of terraform apply, both "metadata" and "all_metadata" fields were recorded in terraform.tfstate.

            "resources": {
                "openstack_compute_instance_v2.test01": {
                    "type": "openstack_compute_instance_v2",
                    "depends_on": [],
                    "primary": {
                        "id": "f29e21b5-47b6-40b1-ae78-cd4993bd39aa",
                        "attributes": {
                            ...
                            "all_metadata.%": "2",
                            "all_metadata.foo": "bar",
                            "all_metadata.terraformer": "test",
                            ...
                            "metadata.%": "2",
                            "metadata.foo": "bar",
                            "metadata.terraformer": "test",

I will fix the code to record both fields to tfstate.
Replacing field name is still necessary for tf files, because "openstack_compute_instance_v2" resource does not supports "all_metadata" field.
https://www.terraform.io/docs/providers/openstack/r/compute_instance_v2.html#argument-reference

"openstack_networking_secgroup_v2",
"openstack",
map[string]string{
"name": grp.Name,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"openstack_networking_secgroup_rule_v2",
"openstack",
map[string]string{
"id": r.ID,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sergeylanzman sergeylanzman merged commit c1a763b into GoogleCloudPlatform:master May 5, 2019
@sergeylanzman
Copy link
Collaborator

@yukirii Thank you!

@yukirii yukirii deleted the support_openstack_provider branch May 5, 2019 09:19
sergeylanzman pushed a commit that referenced this pull request Jul 9, 2020
* added support in azurerm_app_service

* backup storage_blob.go

* backup storage_blob.go

* use azure-storage-blob-go

* backup

* created storage_blob.go and storage_container.go

* updated README.md

* fixed linter error

* removed licence

* merged security_center_contact and fixed storage_container.go

(cherry picked from commit bc8306a)
sergeylanzman pushed a commit that referenced this pull request Jun 4, 2022
sergeylanzman pushed a commit that referenced this pull request Jun 4, 2022
sergeylanzman pushed a commit that referenced this pull request Feb 7, 2023
* [WIP] add ionoscloud support

* [WIP] add ionoscloud support

* fix: fix set dcId for servers and lan

* vendor update

* docs: added documentations for ionoscloud

* feat: add nic and volume

* fix: remove unnecessary prints from server.go file (#3)

* feat: implement IP Block (#4)

* feat: implement backup unit (#2)

* feat: Implement K8s cluster (#5)

* feat: implement Kubernetes Nodepool (#6)

* fix: resolve import inconsistency (#7)

* fix: fix IONOS_TOKEN authentication (#9)

* feat: add extra checks for resources (#10)

* feat: implement target group (#8)

* fix: remove unnecessary check and test statement (#13)

* feat: implement network load balancer (#14)

* feat: implement NAT gateway (#12)

* feat: implement group (#11)

* feat: implement application load balancer (#15)

* feat: fix server corner cases. k8s server should not be written to plan.

* Implement firewall resource, fix name typo, change nic logic (#16)

* implement NLB forwarding rule (#17)

* Implement load balancer (#18)

* feat: implement NAT gateway rule (#19)

* fix: rename generator string (#20)

* feat: rename variable, add condition if server valid, firewall link to other resources

* feat: improve doc

* feat: use variables for hardcoded strings

* feat: link remaining resources

* doc: update README.md

* fix: add links to supported resources

* fix: add links to supported resources

* fix: remove 'Printf' calls from utils.go (#23)

* refactor: fix linter errors (#24)

---------

Co-authored-by: iblindu <iuliaioana.blindu@gmail.com>
Co-authored-by: cristi <cristian.mihai.guran@ionos.com>
Co-authored-by: cguran-ionos <cristian-mihai.guran@ionos.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants