aws.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:spark-notebook 作者: mas-dse 项目源码 文件源码
def get_subnets(self):
        try:
            client = boto3.client('ec2',
                                  aws_access_key_id=self.access_key_id,
                                  aws_secret_access_key=self.secret_access_key,
                                  region_name=self.region_name)
        except Exception as e:
            raise AWSException("There was an error connecting to EC2: %s" % e)

        # Search EC2 for the VPC subnets
        try:
            return client.describe_subnets()
        except botocore.exceptions.ClientError as e:
            raise AWSException("There was an error describing the VPC Subnets: %s" %
                               e.response["Error"]["Message"])
        except botocore.exceptions.ParamValidationError as e:
            raise AWSException("There was an error describing the VPC Subnets: %s" % e)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号