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 license-specifications and placement/host-resource-group-arn #109

Merged

Conversation

KhrisRichardson-BO
Copy link
Contributor

This PR adds support for scheduling instances to host resource groups, which likewise requires the declaration of a license configuration.

While the AWS SDK allows for a collection of license configurations, this PR flattens that to one in accordance with some of the other conventions observed. I'm open to changing that decision, updating the data model to more accurately reflect the collection of license configurations that comprise a license specification.

In all honesty I would prefer to group the tenancy and host_resource_group_arn settings under a placement grouping, but I wasn't sure what the policy was around backwards compatibility or the general attitude around adherence to the AWS SDK schema vs. flattening to provoke the end user to use simple variable names that they can override via vars arguments on the command line.

Any input is welcome. Thanks

@KhrisRichardson-BO KhrisRichardson-BO requested a review from a team as a code owner July 20, 2021 17:53
@hashicorp-cla
Copy link

hashicorp-cla commented Jul 20, 2021

CLA assistant check
All committers have signed the CLA.

@azr
Copy link
Contributor

azr commented Nov 29, 2021

but I wasn't sure what the policy was around backwards compatibility or the general attitude around adherence to the AWS SDK schema vs. flattening

So the closer we are to the aws sdk schema and naming the better we generally think. In terms of backwards compatibility, a pattern we have often used when justified — and I think it would be justified here — was to have a deprecation period where both fields work in between.

Let me know what you prefer 🙂

@KhrisRichardson-BO KhrisRichardson-BO force-pushed the placement-host-resource-group-arn branch 2 times, most recently from b0ed976 to dcf0739 Compare December 8, 2021 00:11
@KhrisRichardson-BO
Copy link
Contributor Author

@azr I've updated the PR so that there's more coherence with the AWS SDK, including adding tenancy under placement with some deprecation warnings. I'm open to any suggestions.

P.S. there was one small ancillary edit made to make golangci-lint happy.

Thanks!

builder/common/run_config.go Outdated Show resolved Hide resolved
Copy link
Contributor

@azr azr left a comment

Choose a reason for hiding this comment

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

This looks good to me. I would polish docs a little more :). I'll be waiting a little more for that.

Comment on lines +443 to +448
// Each `license_configuration_request` describes a license configuration,
// the properties of which are:
//
// - `license_configuration_arn` (string) - The Amazon Resource Name (ARN)
// of the license configuration.
//
Copy link
Contributor

Choose a reason for hiding this comment

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

🤩 so nice !

// of the license configuration.
//
LicenseSpecifications []LicenseSpecification `mapstructure:"license_specifications" required:"false"`
// Describes the placement of an instance.
Copy link
Contributor

@azr azr Dec 20, 2021

Choose a reason for hiding this comment

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

Should we describe the default behavior too here ?

We could say: When no placement is specified, shared tenancy will be selected. or something? Is that even correct ?

Choose a reason for hiding this comment

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

@azr the docs don't really go into much detail about the default placement. My interpretation is that these are scheduling hints that EC2 uses to filter the host onto which the instance is scheduled, otherwise EC2 chooses at random using black box heuristics that are unknown to/unknowable by the end-user.

@azr
Copy link
Contributor

azr commented Dec 20, 2021

Thanks for addressing the docs changes, they looked great, I just have a tiny question/suggestion, and we should be good !

Copy link
Contributor

@azr azr left a comment

Choose a reason for hiding this comment

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

This looks pretty good to me, thanks for answering my questions, thanks for your time, etc !

@azr azr merged commit 1806715 into hashicorp:main Jan 11, 2022
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.

None yet

4 participants