This repository has been archived by the owner on Feb 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: Updating EC2 deploy to latest spec (#12)
* operator_config for aws-ec2 * updated file structure * fix: relative import issues * added operator_config.py for file * fix: changes to make it work as operators * test: fixed the tests for ec2 * ci: changed the secrets used * test * Updated readme for latest operator changes - updated config - remove gif - new quick start for bentoctl and scripts * Update README.md
- Loading branch information
Showing
19 changed files
with
406 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from .deploy import deploy | ||
from .update import update | ||
from .describe import describe | ||
from .delete import delete | ||
|
||
__all__ = ["deploy", "update", "describe", "delete"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import boto3 | ||
from botocore.exceptions import ClientError | ||
|
||
from .ec2 import generate_ec2_resource_names | ||
from .utils import console | ||
|
||
|
||
def delete(deployment_name, ec2_config): | ||
_, stack_name, repo_name, _ = generate_ec2_resource_names( | ||
deployment_name | ||
) | ||
cf_client = boto3.client("cloudformation", ec2_config["region"]) | ||
console.print(f"Delete CloudFormation Stack [b]{stack_name}[/b]") | ||
cf_client.delete_stack(StackName=stack_name) | ||
|
||
# delete ecr repository | ||
ecr_client = boto3.client("ecr", ec2_config["region"]) | ||
try: | ||
console.print(f"Delete ECR repo [b]{repo_name}[/b]") | ||
ecr_client.delete_repository(repositoryName=repo_name, force=True) | ||
except ClientError as e: | ||
# raise error, if the repo can't be found | ||
if e.response and e.response["Error"]["Code"] != "RepositoryNotFoundException": | ||
raise e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.