-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: Add aws elastic beanstalk solution stack #14944
provider/aws: Add aws elastic beanstalk solution stack #14944
Conversation
Signed-off-by: Thomas Schaaf <thomaschaaf@Thomass-MBP.fritz.box>
Signed-off-by: Thomas Schaaf <thomaschaaf@Thomass-MBP.fritz.box>
Signed-off-by: Thomas Schaaf <thomaschaaf@Thomass-MacBook-Pro.local>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @thomaschaaf
Thanks for the work here - I have made 1 suggestion around required params and left a question on the sorting
Apart from that, your docs need adding to aws.erb
If we can get these added / changed then this LGTM
Thanks
Paul
func dataSourceAwsElasticBeanstalkSolutionStackRead(d *schema.ResourceData, meta interface{}) error { | ||
conn := meta.(*AWSClient).elasticbeanstalkconn | ||
|
||
nameRegex, nameRegexOk := d.GetOk("name_regex") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do this a different way. If we mark the schema param as required, then we won't need to use d.GetOk
and it will validate at plan time
} | ||
|
||
var solutionStack *string | ||
if len(filteredSolutionStacks) < 1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can say if len == 0 rather than < 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it as desired
|
||
// Returns the most recent solution stack out of a slice of stacks. | ||
func mostRecentSolutionStack(solutionStacks []*string) *string { | ||
return solutionStacks[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this guaranteed to be the most recent? Don't use need to sort these using a date or something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API returns them sorted. The newest should thus always be first. 🤞
…thub.com:thomaschaaf/terraform into data_source_aws_elastic_beanstalk_solution_stack
@stack72 hopefully now :) |
Hi @thomaschaaf Thanks for fixing these up - unfortunately, the acceptance test doesn't pass
Can you take a look? Paul |
Hey Paul/@stack72 , I didn't know about these tests and thought as travis is green everything was working. Thomas |
Awesome! this LGTM now
|
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Adds: #14749