Skip to content

Commit

Permalink
Merge pull request #266 from cloudify-cosmo/dev
Browse files Browse the repository at this point in the history
adding elastic ip stuff
  • Loading branch information
EarthmanT committed Mar 3, 2019
2 parents 6a85ca9 + 1bee8c8 commit 7cbf546
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 7 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.txt
Expand Up @@ -54,4 +54,6 @@
- Update aws plugin node types
- Update python aws boto to boto3
- Add blueprint examples that covers all node types for the plugin
- Update integration tests
- Update integration tests
2.0.1:
- Support attach external address to nic.
2 changes: 1 addition & 1 deletion cloudify_aws/ec2/resources/elasticip.py
Expand Up @@ -174,7 +174,7 @@ def attach(ctx, iface, resource_config, **_):
if not allocation_id:
allocation_id = \
ctx.instance.runtime_properties.get(
'allocation_id')
'allocation_id', iface.properties.get('AllocationId'))
params[ALLOCATION_ID] = allocation_id

if not elasticip_id and not allocation_id:
Expand Down
61 changes: 61 additions & 0 deletions examples/ec2-instance-feature-demo/eip-nic-blueprint.yaml
@@ -0,0 +1,61 @@
tosca_definitions_version: cloudify_dsl_1_3
imports:
- http://www.getcloudify.org/spec/cloudify/4.5/types.yaml
- plugin:cloudify-aws-plugin
inputs:
aws_access_key_id:
type: string
description: YOUR AWS ACCESS KEY ID
default: { get_secret: aws_access_key_id }
aws_secret_access_key:
type: string
description: YOUR AWS SECRET ACCESS KEY
default: { get_secret: aws_secret_access_key }
region_name:
type: string
description: YOUR AWS Region
default: { get_secret: aws_region_name }
ec2_region_endpoint:
type: string
description: YOUR AWS Region endpoint
default: { get_secret: ec2_region_endpoint }
availability_zone:
type: string
description: Your AWS Region availability_zone.
default: { get_secret: aws_availability_zone }
use_external_ip:
type: boolean
default: False
existing_ip:
type: string
default: ''
subnet_id:
type: string
dsl_definitions:
client_config: &client_config
aws_access_key_id: { get_input: aws_access_key_id }
aws_secret_access_key: { get_input: aws_secret_access_key }
region_name: { get_input: aws_region_name }
node_templates:
nic:
type: cloudify.nodes.aws.ec2.Interface
properties:
client_config: *client_config
resource_config:
kwargs:
Description: Test EIP/NICs.
SubnetId: { get_input: subnet_id }
eip:
type: cloudify.nodes.aws.ec2.ElasticIP
properties:
client_config: *client_config
use_external_resource: { get_input: use_external_ip }
resource_id: { get_input: existing_ip }
relationships:
- type: cloudify.relationships.depends_on
target: nic
outputs:
nic_id:
value: { get_attribute: [ nic, aws_resource_id ] }
eip_id:
value: { get_attribute: [ eip, aws_resource_id ] }
14 changes: 10 additions & 4 deletions plugin.yaml
Expand Up @@ -2,9 +2,9 @@ plugins:

aws:
executor: central_deployment_agent
source: https://github.com/cloudify-cosmo/cloudify-aws-plugin/archive/2.0.0.zip
source: https://github.com/cloudify-cosmo/cloudify-aws-plugin/archive/2.0.1.zip
package_name: cloudify-aws-plugin
package_version: '2.0.0'
package_version: '2.0.1'

data_types:

Expand Down Expand Up @@ -2437,10 +2437,16 @@ node_types:
inputs: *operation_inputs
start:
implementation: aws.cloudify_aws.ec2.resources.elasticip.attach
inputs: *operation_inputs
inputs:
<<: *operation_inputs
force_operation:
default: true
stop:
implementation: aws.cloudify_aws.ec2.resources.elasticip.detach
inputs: *operation_inputs
inputs:
<<: *operation_inputs
force_operation:
default: true
delete:
implementation: aws.cloudify_aws.ec2.resources.elasticip.delete
inputs: *operation_inputs
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -19,7 +19,7 @@

setup(
name='cloudify-aws-plugin',
version='2.0.0',
version='2.0.1',
author='Cloudify Platform Ltd.',
author_email='hello@cloudify.co',
license='LICENSE',
Expand Down

0 comments on commit 7cbf546

Please sign in to comment.