aws_codeseeder.commands

Package Contents

Functions

deploy_modules(seedkit_name: str, python_modules: List[str], session: Optional[Union[Callable[[], boto3.Session], boto3.Session]] = None) → None

Deploy local Python modules to the CodeArtifact Domain/Repository associated with a Seedkit

deploy_seedkit(seedkit_name: str, managed_policy_arns: Optional[List[str]] = None, deploy_codeartifact: bool = False, session: Optional[Union[Callable[[], boto3.Session], boto3.Session]] = None, vpc_id: Optional[str] = None, subnet_ids: Optional[List[str]] = None, security_group_ids: Optional[List[str]] = None) → None

Deploys the seedkit resources into the environment.

destroy_seedkit(seedkit_name: str, session: Optional[Union[Callable[[], boto3.Session], boto3.Session]] = None) → None

Destroys the resources associated with the seedkit.

seedkit_deployed(seedkit_name: str, session: Optional[Union[Callable[[], boto3.Session], boto3.Session]] = None) → Tuple[bool, str, Dict[str, str]]

Checks for existence of the Seedkit CloudFormation Stack

aws_codeseeder.commands.deploy_modules(seedkit_name: str, python_modules: List[str], session: Optional[Union[Callable[[], boto3.Session], boto3.Session]] = None) None

Deploy local Python modules to the CodeArtifact Domain/Repository associated with a Seedkit

This is a utility function that attempts to package and deploy local Python projects to CodeArtifact for use in CodeBuild executions.

Parameters
  • seedkit_name (str) – Name of a previously deployed Seedkit

  • python_modules (List[str]) – List of local Python modules/projects to deploy. Each module is of the form “[package-name]:[directory]” where [package-name] is the name of the Python package and [directory] is the local location of the module/project

  • session (Optional[Union[Callable[[], Session], Session]], optional) – Optional Session or function returning a Session to use for all boto3 operations, by default None

Raises

ValueError – If module names are of the wrong form

aws_codeseeder.commands.deploy_seedkit(seedkit_name: str, managed_policy_arns: Optional[List[str]] = None, deploy_codeartifact: bool = False, session: Optional[Union[Callable[[], boto3.Session], boto3.Session]] = None, vpc_id: Optional[str] = None, subnet_ids: Optional[List[str]] = None, security_group_ids: Optional[List[str]] = None) None

Deploys the seedkit resources into the environment.

Resources deployed include: S3 Bucket, CodeArtifact Domain, CodeArtifact Repository, CodeBuild Project, IAM Role, IAM Managed Policy, and KMS Key. All resource names will include the seedkit_name and IAM Role and Policy grant least privilege access to only the resources associated with this Seedkit. Seedkits are deployed to an AWS Region, names on global resources (S3, IAM) include a region identifier to avoid conflicts and ensure the same Seedkit name can be deployed to multiple regions.

Parameters
  • seedkit_name (str) – Name of the seedkit to deploy. All resources will include this in their naming conventions

  • managed_policy_arns (Optional[List[str]]) – List of Managed Policy to ARNs to attach to the default IAM Role created and used by the CodeBuild Project

  • deploy_codeartifact (bool) – Trigger optional deployment of CodeArtifact Domain and Repository for use by the Seedkit and its libraries

  • session (Optional[Union[Callable[[], Session], Session]], optional) – Optional Session or function returning a Session to use for all boto3 operations, by default None

  • vpc_id (Optional[str]) – If deploying codebuild in a VPC, the VPC-ID to use (must have vpc-id, subnets, and security_group_ids)

  • subnet_ids (Optional[List[str]]) – If deploying codebuild in a VPC, a list of Subnets to use (must have vpc-id, subnets, and security_group_ids)

  • security_group_ids (Optional[List[str]]) – If deploying codebuild in a VPC, a list of Security Group IDs to use (must have vpc-id, subnets, and security_group_ids)

aws_codeseeder.commands.destroy_seedkit(seedkit_name: str, session: Optional[Union[Callable[[], boto3.Session], boto3.Session]] = None) None

Destroys the resources associated with the seedkit.

Parameters
  • seedkit_name (str) – Name of the seedkit to destroy

  • session (Optional[Union[Callable[[], Session], Session]], optional) – Optional Session or function returning a Session to use for all boto3 operations, by default None

aws_codeseeder.commands.seedkit_deployed(seedkit_name: str, session: Optional[Union[Callable[[], boto3.Session], boto3.Session]] = None) Tuple[bool, str, Dict[str, str]]

Checks for existence of the Seedkit CloudFormation Stack

If the Stack exists, then the Stack Outputs are also returned to eliminate need for another roundtrip call to CloudFormation.

Parameters
  • seedkit_name (str) – Named of the seedkit to check.

  • session (Optional[Union[Callable[[], Session], Session]], optional) – Optional Session or function returning a Session to use for all boto3 operations, by default None

Returns

Returns a Tuple with a bool indicating existence of the Stack, the Stack name, and a dict with the Stack Outputs

Return type

Tuple[bool, str, Dict[str, str]]