MCPcopy Index your code
hub / github.com/aws/aws-cli / validate_s3_location

Function validate_s3_location

awscli/customizations/codedeploy/utils.py:123–136  ·  view source on GitHub ↗
(params, arg_name)

Source from the content-addressed store, hash-verified

121
122
123def validate_s3_location(params, arg_name):
124 arg_name = arg_name.replace('-', '_')
125 if arg_name in params:
126 s3_location = getattr(params, arg_name)
127 if s3_location:
128 matcher = re.match('s3://(.+?)/(.+)', str(s3_location))
129 if matcher:
130 params.bucket = matcher.group(1)
131 params.key = matcher.group(2)
132 else:
133 raise ParamValidationError(
134 '--{0} must specify the Amazon S3 URL format as '
135 's3://<bucket>/<key>.'.format(arg_name.replace('_', '-'))
136 )

Calls 3

matchMethod · 0.80
formatMethod · 0.80