diff --git a/src/starfleet/worker_ships/plugins/iam/role_ship.py b/src/starfleet/worker_ships/plugins/iam/role_ship.py index 97765f9..4a150a0 100644 --- a/src/starfleet/worker_ships/plugins/iam/role_ship.py +++ b/src/starfleet/worker_ships/plugins/iam/role_ship.py @@ -37,7 +37,6 @@ make_iambic_variables, ) from starfleet.worker_ships.ship_schematics import StarfleetWorkerShip, FanOutStrategy, AlertPriority -from starfleet.worker_ships.plugins.iam.iambic_imports import AWSAccount, AwsIamRoleTemplate, iambic_ctx class IambicFailedError(Exception): @@ -65,13 +64,17 @@ def render_iambic_template(self, commit: bool = False) -> Dict[str, Any]: """This will render the iambic template and return it back out.""" return render_iambic_template(self.payload, IambicTemplateTypes.IAM_ROLE, commit) - def prepare_iambic_template(self, rendered_template: Dict[str, Any]) -> AwsIamRoleTemplate: + def prepare_iambic_template(self, rendered_template: Dict[str, Any]) -> "AwsIamRoleTemplate": """This will perform the additional validation that is needed to load and generate the iambic template.""" + from starfleet.worker_ships.plugins.iam.iambic_imports import AwsIamRoleTemplate + AwsIamRoleTemplate.update_forward_refs() return AwsIamRoleTemplate(**rendered_template) def execute(self, commit: bool = False) -> None: """Execute the payload to sync out.""" + from starfleet.worker_ships.plugins.iam.iambic_imports import AWSAccount, iambic_ctx + config = self.configuration_template_class().load(STARFLEET_CONFIGURATION.config[self.worker_ship_name]) # Pull out the payload details for this account: diff --git a/src/starfleet/worker_ships/plugins/iam/schemas.py b/src/starfleet/worker_ships/plugins/iam/schemas.py index 6e182e2..f77264d 100644 --- a/src/starfleet/worker_ships/plugins/iam/schemas.py +++ b/src/starfleet/worker_ships/plugins/iam/schemas.py @@ -15,7 +15,6 @@ from starfleet.utils.logging import LOGGER from starfleet.worker_ships.base_payload_schemas import IncludeAccountsSpecificationSchema, AccountsSpecificationSchema, BaseAccountPayloadTemplate from starfleet.worker_ships.ship_schematics import WorkerShipBaseConfigurationTemplate -from starfleet.worker_ships.plugins.iam.iambic_imports import Variable class IambicTemplateTypes(Enum): @@ -69,8 +68,9 @@ def render_iambic_template(template: Dict[str, Any], template_type: IambicTempla return rendered_template -def make_iambic_variables(template_variables: List[Dict[str, str]]) -> List[Variable]: +def make_iambic_variables(template_variables: List[Dict[str, str]]) -> List["Variable"]: """This will make the iambic variable objects from the Starfleet template variables.""" + from starfleet.worker_ships.plugins.iam.iambic_imports import Variable iambic_variables = [] for variable in template_variables: