Skip to content

Commit cfeef7d

Browse files
authored
Merge pull request #642 from smoy/feat/641-warn-about-import-only-templates
Implement #641 for AWS resources (info about template being marked as IMPORT_ONLY
2 parents 4f6c98d + 90b5fc0 commit cfeef7d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

iambic/plugins/v0_1_0/aws/models.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ async def _apply_to_account(
924924
) -> AccountChangeDetails:
925925
raise NotImplementedError
926926

927-
async def apply(self, config: AWSConfig) -> TemplateChangeDetails:
927+
async def apply(self, config: AWSConfig) -> TemplateChangeDetails: # noqa: C901
928928
tasks = []
929929
template_changes = TemplateChangeDetails(
930930
resource_id=self.resource_id,
@@ -936,6 +936,15 @@ async def apply(self, config: AWSConfig) -> TemplateChangeDetails:
936936
)
937937
relevant_accounts = []
938938

939+
# issue #641, to help users to catch that resource is explictly marked
940+
# as IMPORT_ONLY. so its easy to understand where is no change from
941+
# plan or apply
942+
if self.iambic_managed == IambicManaged.IMPORT_ONLY:
943+
log_str = "Resource is marked as import only."
944+
log.info(log_str, **log_params)
945+
template_changes.proposed_changes = []
946+
return template_changes
947+
939948
for account in config.accounts:
940949
if evaluate_on_provider(self, account):
941950
relevant_accounts.append(account)

0 commit comments

Comments
 (0)