-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add support for VPCOptions in ElasticSearch #862
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 support for VPCOptions in ElasticSearch #862
Conversation
As @craigbruce pointed out, seems that CloudFormation does not support VCPOptions #861 (comment) |
I created a new label for it so we can leave it here in case it gets implemented soon in CF. Thanks. |
…elasticsearch-vpcoptions
@markpeek |
troposphere/elasticsearch.py
Outdated
} | ||
|
||
class VPCOptions(AWSProperty): |
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.
@markpeek AWSProperty
, right?
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.
Really close to getting this one done. I added some comments to help out. Also, if you run "make test" you can test locally to fix issues before committing. Thanks for working on this one.
troposphere/elasticsearch.py
Outdated
@@ -55,6 +55,13 @@ class SnapshotOptions(AWSProperty): | |||
} | |||
|
|||
|
|||
class VPCOptions(AWSProperty): | |||
props = { | |||
"SecurityGroupIds": (dict, False), |
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.
These should be list of strings:
"SecurityGroupIds": ([basestring], False),
"SubnetIds": ([basestring], False)
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.
You are totally right!
examples/ElasticsearchDomain.py
Outdated
@@ -36,7 +36,14 @@ | |||
'Action': 'es:*', | |||
'Resource': '*' | |||
}]}, | |||
AdvancedOptions={"rest.action.multi.allow_explicit_index": "true"} | |||
AdvancedOptions={"rest.action.multi.allow_explicit_index": "true"}, | |||
VPCOptions={'SubnetIds': [ |
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.
This should be (and you'll need an import at the top for VPCOptions):
VPCOptions=VPCOptions(
SubnetIds=["subnet-4f2bb123"],
SecurityGroupIds=["sg-04cf048c"],
),
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.
Also, the "Ref" is a bit of a misnomer given the subnets/sg's aren't defined in this example. Really you're accessing already defined subnets/security groups.
@@ -36,6 +36,14 @@ | |||
}, | |||
"SnapshotOptions": { | |||
"AutomatedSnapshotStartHour": 0 | |||
}, | |||
"VPCOptions": { |
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.
Fix this up given the change above.
Thanks @markpeek! All changes are done and tests are green :) |
Nice! Thank you for implementing this addition. |
Thank you for your support! 😄 |
Hello :)
I'm trying to solve this issue I opened some minutes ago #861
The idea is to add support for VPCOptions in ElasticSearch (you will find more info in the issue).
Hope this works!