-
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 FlowLog resource #2384
Conversation
@@ -85,12 +85,13 @@ func Provider() terraform.ResourceProvider { | |||
ResourcesMap: map[string]*schema.Resource{ | |||
"aws_app_cookie_stickiness_policy": resourceAwsAppCookieStickinessPolicy(), | |||
"aws_autoscaling_group": resourceAwsAutoscalingGroup(), | |||
"aws_flow_log": resourceAwsFlowLog(), |
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.
Alphabetize por favor! 🔠 😁
cc @radeksimko since I know he has at least looked into Flow Logs |
return nil | ||
} | ||
|
||
func flowLogStateRefreshFunc(conn *ec2.EC2, sn string) resource.StateRefreshFunc { |
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.
Looks like this guy is unused.
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.
😱
Review complete - Looking great overall! |
"testing" | ||
|
||
"github.com/aws/aws-sdk-go/service/ec2" | ||
"github.com/hashicorp/aws-sdk-go/aws" |
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.
why this import?
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.
Wow, great catch! My editor must have auto populated that 😱
Fixed in 0bf127a
@phinze cleaned up, sorry for the sloppy 😐 |
} | ||
|
||
log.Printf( | ||
"[DEBUG] Flow Log Create configuration: %s", awsutil.StringValue(opts)) |
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.
Nice! 👍 Isn't this basically addressing #2179 ?
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.
awsutil.StringValue
does, yes, but to close #2179 we need to use it in All The Places™
@catsby It looks ok, just one question here: I thought that change in the state should be changed because user/human has done something in order to change the state. My understanding is that these two things will change without user's interaction over time and so far I don't see how would any other Terraform resource react on that. |
I reckon this can be fixed later on after merging, but just FYI regarding example in docs: http://docs.aws.amazon.com/cli/latest/reference/ec2/create-flow-logs.html
We're not defining that permission anywhere. |
* master: Update CHANGELOG.md Update CHANGELOG.md Added affinity group resource. update link to actually work provider/azure: Fix SQL client name to match upstream add warning message to explain scenario of conflicting rules typo remove debugging Update CHANGELOG.md provider/aws: Add docs for autoscaling_policy + cloudwatch_metric_alarm provider/aws: Add autoscaling_policy provider/aws: Add cloudwatch_metric_alarm rename method, update docs clean up some conflicts with clean up old, incompatible test update tests with another example update test remove meta usage, stub test fix existing tests Consider security groups with source security groups when hashing
@radeksimko Thanks for reviewing
I thought it would be useful, but in hindsight agree, so I removed them in 87c7f63
I updated the documentation to include the needed IAM things to get Flow Logs working, and verified they work. The Logs must Flow |
LGTM |
provider/aws: Add FlowLog resource
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. |
This is a proposal config/work for adding a FlowLog resource.
Syntax:
API Docs:
Update
orModify
, things will beForceNew
.A
FlowLog
can be attached to either a VPC, Subnet, or ENI. The API call is the same, you just supply the resourceid
andtype
. Here I propose separatevpc_id
,subnet_id
, andeni_id
syntax, to avoid a user having to specify both a resourceid
and the type.Additionally, the API supports creating multiple flows in a single call, but this creates multiple
FlowLog
s, , so our implementation will be 1:1.Remaining: