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

Add (Region)Autoscaler #307

Merged
merged 21 commits into from
Jun 28, 2018
Merged

Add (Region)Autoscaler #307

merged 21 commits into from
Jun 28, 2018

Conversation

danawillow
Copy link
Contributor

Adds Autoscaler and RegionAutoscaler to Magic Modules.

For now, I've excluded them from the other providers because there's still a little bit of work to be done there around the custom update_url (and we'll want to decide if we want to release RegionAutoscaler before RegionInstanceGroupManager exists, and potentially other stuff), but I'd also be ok with going in and making those changes if you think it's important to do now

Other things this does besides just raw generation:

  • Adds an update_url field for resources that support PUTting the whole resource but have a custom URL involved in that.
  • Adds a new custom Terraform expander for values that have to be URL-shaped
  • Fixes a bug in the Terraform templates where nested fields weren't getting renamed
  • Copies the Terraform autoscaler tests here because there were some changes I needed to make around the id format.

[all]

[terraform]

Add generated google_compute_autoscaler and google_compute_region_autoscaler resources. Because this adds the ability to import by more than just the name, we can get rid of all the code in resource_compute_autoscaler.go that tries to find the autoscaler in the provider-specified region.

[puppet]

[puppet-compute]

[puppet-sql]

[puppet-storage]

[chef]

[chef-compute]

[chef-sql]

[chef-storage]

[ansible]

@modular-magician
Copy link
Collaborator

I am a robot that works on MagicModules PRs!

I built this PR into one or more PRs on other repositories, and when those are closed, this PR will also be merged and closed.
depends: hashicorp/terraform-provider-google#1700
depends: GoogleCloudPlatform/puppet-google-compute#55
depends: GoogleCloudPlatform/chef-google-compute#23

@modular-magician
Copy link
Collaborator

I am (still) a robot that works on MagicModules PRs!

I just wanted to let you know that your changes (as of commit 6478c5b) have been included in your existing downstream PRs.

@modular-magician
Copy link
Collaborator

I am (still) a robot that works on MagicModules PRs!

I just wanted to let you know that your changes (as of commit 1d88ab9) have been included in your existing downstream PRs.

@@ -322,7 +322,7 @@ func resource<%= resource_name -%>Update(d *schema.ResourceData, meta interface{
<% elsif object.custom_code.encoder -%>
obj, err = resource<%= resource_name -%>Encoder(d, meta, obj)
<% end -%>
url, err := replaceVars(d, config, "<%= self_link_url(object) -%>")
url, err := replaceVars(d, config, "<%= update_url(object, object.update_url) -%>")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this logic belongs in core, and should be in PCA also. It does have to get done next quarter if not today.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair. In the interest of keeping PRs smallish, I'm not going to do it now (doing so would merit adding Autoscaler to the other providers to show that it works, which means adding examples and testing to make sure they actually work. this is non-trivial enough that I'd like to take my time on it)

api/resource.rb Outdated
@@ -26,6 +26,7 @@ module Properties
attr_reader :description
attr_reader :kind
attr_reader :base_url
attr_reader :update_url
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment here explaining what this is for? And add it to the spreadsheet of resource attributes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done and done

@modular-magician
Copy link
Collaborator

I am (still) a robot that works on MagicModules PRs!

I just wanted to let you know that your changes (as of commit ca8937d) have been included in your existing downstream PRs.

josephlewis42 and others added 14 commits June 27, 2018 10:16
Readability improvements for things I stumbled over the first time going through the philosophy doc.

 * Syntax highlighting
 * Consistent pluralization
 * gendered -> non-gendered pronoun
Added documentation for resource and imports resource fields
Note: This deletes the Git hook that enforced the presubmit script and required
the NO_SQ=1 flag. You may have to fiddle a bit with your Git repo if it still
uses this git hook
Tracked submodules are build/puppet/compute build/puppet/sql build/puppet/storage build/chef/compute build/chef/sql build/chef/storage build/terraform build/ansible.
@modular-magician modular-magician merged commit a9cb75c into master Jun 28, 2018
@danawillow danawillow deleted the autoscaler branch June 28, 2018 18:49
@modular-magician
Copy link
Collaborator

I am (still) a robot that works on MagicModules PRs!

I just wanted to let you know that your changes (as of commit 8f4c816) have been included in your existing downstream PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants