def __init__(self, ctx_node, resource_id=None, client=None, logger=None): AWSCloudwatchBase.__init__( self, ctx_node, resource_id, client or Boto3Connection(ctx_node).client('events'), logger) self.type_name = RESOURCE_TYPE
def __init__(self, ctx_node, resource_id=None, client=None, logger=None): ELBBase.__init__( self, ctx_node, resource_id, client or Boto3Connection(ctx_node).client('elbv2'), logger) self.type_name = RESOURCE_TYPE
def test_client_direct_params(self): node = MagicMock() node.properties = {} connection = Boto3Connection(node, copy.deepcopy(CLIENT_CONFIG)) connection.client('abc') self.fake_boto.assert_called_with('abc', **CLIENT_CONFIG)
def __init__(self, ctx_node, resource_id=None, client=None, logger=None): if not client: aws_config = ctx_node.properties.get(AWS_CONFIG_PROPERTY, dict()) check_region_name(aws_config['region_name']) AWSResourceBase.__init__(self, client or Boto3Connection(ctx_node).client('ec2'), resource_id=resource_id, logger=logger)
def __init__(self, ctx_node, aws_config=None, resource_id=None, client=None, logger=None): AWSResourceBase.__init__( self, client or Boto3Connection(ctx_node, aws_config).client('s3'), resource_id=resource_id, logger=logger)
def test_client_node_params(self): node = MagicMock() node.properties = {'client_config': copy.deepcopy(CLIENT_CONFIG)} connection = Boto3Connection(node, {'a': 'b'}) connection.client('abc') self.fake_boto.assert_called_with('abc', **CLIENT_CONFIG) self.assertEqual(connection.aws_config, CLIENT_CONFIG)
def prepare_assoc(ctx, iface, resource_config, **inputs): '''Prepares to associate an Route53 Hosted Zone to something else''' if utils.is_node_type(ctx.target.node, 'cloudify.aws.nodes.VPC'): vpc_id = utils.get_resource_id(node=ctx.target.node, instance=ctx.target.instance, raise_on_missing=True) # Update VPC configuration vpccfg = ctx.source.instance.runtime_properties['resource_config'].get( 'VPC', dict()) vpccfg['VPCId'] = vpc_id if not vpccfg.get('VPCRegion'): vpccfg['VPCRegion'] = detect_vpc_region( Boto3Connection(ctx.source.node).client('ec2'), vpc_id) ctx.source.instance.runtime_properties['resource_config'][ 'VPC'] = vpccfg
def __init__(self, ctx_node, resource_id=None, client=None, logger=None): AWSResourceBase.__init__( self, client or Boto3Connection(ctx_node).client('dynamodb'), resource_id=resource_id, logger=logger)