INNER CODE UNIT · Python

iam_role_exists

miztiik/AWS-Demos · how-to-examples/iam-s3-sqs-sns-video-transcoder.py:286

    def iam_role_exists(self):
        """
        Returns ``True`` if an IAM role exists.
        """
        try:
            self.iam.meta.client.get_role(
                RoleName=self.role_name)
            return True
        except ClientError:
            return None

    def setup_iam_role(self):
        """
        Set up a new IAM role and set its policy to allow Elastic
        Transcoder access to S3 and SNS. Returns the role.
        """
        role = self.iam.create_role(
            RoleName=self.role_name,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…