ecs_composex.iam package

Submodules

ecs_composex.iam.import_sam_policies module

Module to import Policies templates from AWS SAM policies templates.

ecs_composex.iam.import_sam_policies. import_and_cleanse_policies ( ) [source]

Function to go over each policy defined in AWS SAM policies and align it to ECS ComposeX expected format.

Returns

The policies

Return type

dict

Module contents

ecs_composex.iam. add_role_boundaries ( iam_role , policy ) [source]

Function to set permission boundary onto an IAM role

Parameters
  • iam_role ( troposphere.iam.Role ) – the IAM Role to add the boundary to

  • policy ( str ) – the name or ARN of the policy

ecs_composex.iam. define_iam_policy ( policy ) [source]
ecs_composex.iam. service_role_trust_policy ( service_name ) [source]

Simple function to format the trust relationship for a Role and an AWS Service used from lambda-my-aws/ozone

Parameters

service_name ( str ) – name of the ecs_service

Returns

policy document

Return type

dict

ecs_composex.iam. validate_iam_role_arn ( arn ) [source]

Function to validate IAM ROLE ARN format :param str arn: :return: resource match :rtype: re.match