pcf.particle.aws.s3 package

Submodules

pcf.particle.aws.s3.s3_bucket module

class pcf.particle.aws.s3.s3_bucket.S3Bucket(particle_definition, session=None)

Bases: pcf.core.aws_resource.AWSResource

This is the implementation of Amazon’s S3 service.

START_PARAMS_FILTER = {'ACL', 'Bucket', 'CreateBucketConfiguration', 'GrantFullControl', 'GrantRead', 'GrantReadACL', 'GrantReadACP', 'GrantWrite', 'GrantWriteACP'}
UNIQUE_KEYS = ['aws_resource.Bucket']
_set_unique_keys()

Logic that sets keys from state definition that are used to uniquely identify the S3 Bucket

_start()

Creates the S3 bucket Adds Tags to the S3 bucket if specified in custom_config :returns: response of boto3 create_bucket

_stop()

S3 bucket does not have a stopped state so it calls terminate.

_terminate()

Deletes the S3 bucket :returns: response of boto3 delete_bucket

_update()

Not Implemented

equivalent_states = {<State.running: 1>: 1, <State.stopped: 2>: 0, <State.terminated: 3>: 0}
flavor = 's3_bucket'
get_status()

Determines if the bucket exists :returns: status (dict)

is_state_equivalent(state1, state2)

Determines if states are equivalent. Uses equivalent_states defined in the S3Bucket class. :param state1: :type state1: State :param state1: :type state1: State

Returns:bool
state_lookup = {'active': <State.running: 1>, 'inactive': <State.terminated: 3>, 'missing': <State.terminated: 3>}
sync_state()

Calls get status and then sets the current state.

Module contents