aimodelshare 0.3.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aimodelshare/README.md +26 -0
- aimodelshare/__init__.py +100 -0
- aimodelshare/aimsonnx.py +2381 -0
- aimodelshare/api.py +836 -0
- aimodelshare/auth.py +163 -0
- aimodelshare/aws.py +511 -0
- aimodelshare/aws_client.py +173 -0
- aimodelshare/base_image.py +154 -0
- aimodelshare/bucketpolicy.py +106 -0
- aimodelshare/color_mappings/color_mapping_keras.csv +121 -0
- aimodelshare/color_mappings/color_mapping_pytorch.csv +117 -0
- aimodelshare/containerisation.py +244 -0
- aimodelshare/containerization.py +712 -0
- aimodelshare/containerization_templates/Dockerfile.txt +8 -0
- aimodelshare/containerization_templates/Dockerfile_PySpark.txt +23 -0
- aimodelshare/containerization_templates/buildspec.txt +14 -0
- aimodelshare/containerization_templates/lambda_function.txt +40 -0
- aimodelshare/custom_approach/__init__.py +1 -0
- aimodelshare/custom_approach/lambda_function.py +17 -0
- aimodelshare/custom_eval_metrics.py +103 -0
- aimodelshare/data_sharing/__init__.py +0 -0
- aimodelshare/data_sharing/data_sharing_templates/Dockerfile.txt +3 -0
- aimodelshare/data_sharing/data_sharing_templates/__init__.py +1 -0
- aimodelshare/data_sharing/data_sharing_templates/buildspec.txt +15 -0
- aimodelshare/data_sharing/data_sharing_templates/codebuild_policies.txt +129 -0
- aimodelshare/data_sharing/data_sharing_templates/codebuild_trust_relationship.txt +12 -0
- aimodelshare/data_sharing/download_data.py +620 -0
- aimodelshare/data_sharing/share_data.py +373 -0
- aimodelshare/data_sharing/utils.py +8 -0
- aimodelshare/deploy_custom_lambda.py +246 -0
- aimodelshare/documentation/Makefile +20 -0
- aimodelshare/documentation/karma_sphinx_theme/__init__.py +28 -0
- aimodelshare/documentation/karma_sphinx_theme/_version.py +2 -0
- aimodelshare/documentation/karma_sphinx_theme/breadcrumbs.html +70 -0
- aimodelshare/documentation/karma_sphinx_theme/layout.html +172 -0
- aimodelshare/documentation/karma_sphinx_theme/search.html +50 -0
- aimodelshare/documentation/karma_sphinx_theme/searchbox.html +14 -0
- aimodelshare/documentation/karma_sphinx_theme/static/css/custom.css +2 -0
- aimodelshare/documentation/karma_sphinx_theme/static/css/custom.css.map +1 -0
- aimodelshare/documentation/karma_sphinx_theme/static/css/theme.css +2751 -0
- aimodelshare/documentation/karma_sphinx_theme/static/css/theme.css.map +1 -0
- aimodelshare/documentation/karma_sphinx_theme/static/css/theme.min.css +2 -0
- aimodelshare/documentation/karma_sphinx_theme/static/css/theme.min.css.map +1 -0
- aimodelshare/documentation/karma_sphinx_theme/static/font/fontello.eot +0 -0
- aimodelshare/documentation/karma_sphinx_theme/static/font/fontello.svg +32 -0
- aimodelshare/documentation/karma_sphinx_theme/static/font/fontello.ttf +0 -0
- aimodelshare/documentation/karma_sphinx_theme/static/font/fontello.woff +0 -0
- aimodelshare/documentation/karma_sphinx_theme/static/font/fontello.woff2 +0 -0
- aimodelshare/documentation/karma_sphinx_theme/static/js/theme.js +68 -0
- aimodelshare/documentation/karma_sphinx_theme/theme.conf +9 -0
- aimodelshare/documentation/make.bat +35 -0
- aimodelshare/documentation/requirements.txt +2 -0
- aimodelshare/documentation/source/about.rst +18 -0
- aimodelshare/documentation/source/advanced_features.rst +137 -0
- aimodelshare/documentation/source/competition.rst +218 -0
- aimodelshare/documentation/source/conf.py +58 -0
- aimodelshare/documentation/source/create_credentials.rst +86 -0
- aimodelshare/documentation/source/example_notebooks.rst +132 -0
- aimodelshare/documentation/source/functions.rst +151 -0
- aimodelshare/documentation/source/gettingstarted.rst +390 -0
- aimodelshare/documentation/source/images/creds1.png +0 -0
- aimodelshare/documentation/source/images/creds2.png +0 -0
- aimodelshare/documentation/source/images/creds3.png +0 -0
- aimodelshare/documentation/source/images/creds4.png +0 -0
- aimodelshare/documentation/source/images/creds5.png +0 -0
- aimodelshare/documentation/source/images/creds_file_example.png +0 -0
- aimodelshare/documentation/source/images/predict_tab.png +0 -0
- aimodelshare/documentation/source/index.rst +110 -0
- aimodelshare/documentation/source/modelplayground.rst +132 -0
- aimodelshare/exceptions.py +11 -0
- aimodelshare/generatemodelapi.py +1270 -0
- aimodelshare/iam/codebuild_policy.txt +129 -0
- aimodelshare/iam/codebuild_trust_relationship.txt +12 -0
- aimodelshare/iam/lambda_policy.txt +15 -0
- aimodelshare/iam/lambda_trust_relationship.txt +12 -0
- aimodelshare/json_templates/__init__.py +1 -0
- aimodelshare/json_templates/api_json.txt +155 -0
- aimodelshare/json_templates/auth/policy.txt +1 -0
- aimodelshare/json_templates/auth/role.txt +1 -0
- aimodelshare/json_templates/eval/policy.txt +1 -0
- aimodelshare/json_templates/eval/role.txt +1 -0
- aimodelshare/json_templates/function/policy.txt +1 -0
- aimodelshare/json_templates/function/role.txt +1 -0
- aimodelshare/json_templates/integration_response.txt +5 -0
- aimodelshare/json_templates/lambda_policy_1.txt +15 -0
- aimodelshare/json_templates/lambda_policy_2.txt +8 -0
- aimodelshare/json_templates/lambda_role_1.txt +12 -0
- aimodelshare/json_templates/lambda_role_2.txt +16 -0
- aimodelshare/leaderboard.py +174 -0
- aimodelshare/main/1.txt +132 -0
- aimodelshare/main/1B.txt +112 -0
- aimodelshare/main/2.txt +153 -0
- aimodelshare/main/3.txt +134 -0
- aimodelshare/main/4.txt +128 -0
- aimodelshare/main/5.txt +109 -0
- aimodelshare/main/6.txt +105 -0
- aimodelshare/main/7.txt +144 -0
- aimodelshare/main/8.txt +142 -0
- aimodelshare/main/__init__.py +1 -0
- aimodelshare/main/authorization.txt +275 -0
- aimodelshare/main/eval_classification.txt +79 -0
- aimodelshare/main/eval_lambda.txt +1709 -0
- aimodelshare/main/eval_regression.txt +80 -0
- aimodelshare/main/lambda_function.txt +8 -0
- aimodelshare/main/nst.txt +149 -0
- aimodelshare/model.py +1543 -0
- aimodelshare/modeluser.py +215 -0
- aimodelshare/moral_compass/README.md +408 -0
- aimodelshare/moral_compass/__init__.py +65 -0
- aimodelshare/moral_compass/_version.py +3 -0
- aimodelshare/moral_compass/api_client.py +601 -0
- aimodelshare/moral_compass/apps/__init__.py +69 -0
- aimodelshare/moral_compass/apps/ai_consequences.py +540 -0
- aimodelshare/moral_compass/apps/bias_detective.py +714 -0
- aimodelshare/moral_compass/apps/ethical_revelation.py +898 -0
- aimodelshare/moral_compass/apps/fairness_fixer.py +889 -0
- aimodelshare/moral_compass/apps/judge.py +888 -0
- aimodelshare/moral_compass/apps/justice_equity_upgrade.py +853 -0
- aimodelshare/moral_compass/apps/mc_integration_helpers.py +820 -0
- aimodelshare/moral_compass/apps/model_building_game.py +1104 -0
- aimodelshare/moral_compass/apps/model_building_game_beginner.py +687 -0
- aimodelshare/moral_compass/apps/moral_compass_challenge.py +858 -0
- aimodelshare/moral_compass/apps/session_auth.py +254 -0
- aimodelshare/moral_compass/apps/shared_activity_styles.css +349 -0
- aimodelshare/moral_compass/apps/tutorial.py +481 -0
- aimodelshare/moral_compass/apps/what_is_ai.py +853 -0
- aimodelshare/moral_compass/challenge.py +365 -0
- aimodelshare/moral_compass/config.py +187 -0
- aimodelshare/placeholders/model.onnx +0 -0
- aimodelshare/placeholders/preprocessor.zip +0 -0
- aimodelshare/playground.py +1968 -0
- aimodelshare/postprocessormodules.py +157 -0
- aimodelshare/preprocessormodules.py +373 -0
- aimodelshare/pyspark/1.txt +195 -0
- aimodelshare/pyspark/1B.txt +181 -0
- aimodelshare/pyspark/2.txt +220 -0
- aimodelshare/pyspark/3.txt +204 -0
- aimodelshare/pyspark/4.txt +187 -0
- aimodelshare/pyspark/5.txt +178 -0
- aimodelshare/pyspark/6.txt +174 -0
- aimodelshare/pyspark/7.txt +211 -0
- aimodelshare/pyspark/8.txt +206 -0
- aimodelshare/pyspark/__init__.py +1 -0
- aimodelshare/pyspark/authorization.txt +258 -0
- aimodelshare/pyspark/eval_classification.txt +79 -0
- aimodelshare/pyspark/eval_lambda.txt +1441 -0
- aimodelshare/pyspark/eval_regression.txt +80 -0
- aimodelshare/pyspark/lambda_function.txt +8 -0
- aimodelshare/pyspark/nst.txt +213 -0
- aimodelshare/python/my_preprocessor.py +58 -0
- aimodelshare/readme.md +26 -0
- aimodelshare/reproducibility.py +181 -0
- aimodelshare/sam/Dockerfile.txt +8 -0
- aimodelshare/sam/Dockerfile_PySpark.txt +24 -0
- aimodelshare/sam/__init__.py +1 -0
- aimodelshare/sam/buildspec.txt +11 -0
- aimodelshare/sam/codebuild_policies.txt +129 -0
- aimodelshare/sam/codebuild_trust_relationship.txt +12 -0
- aimodelshare/sam/codepipeline_policies.txt +173 -0
- aimodelshare/sam/codepipeline_trust_relationship.txt +12 -0
- aimodelshare/sam/spark-class.txt +2 -0
- aimodelshare/sam/template.txt +54 -0
- aimodelshare/tools.py +103 -0
- aimodelshare/utils/__init__.py +78 -0
- aimodelshare/utils/optional_deps.py +38 -0
- aimodelshare/utils.py +57 -0
- aimodelshare-0.3.7.dist-info/METADATA +298 -0
- aimodelshare-0.3.7.dist-info/RECORD +171 -0
- aimodelshare-0.3.7.dist-info/WHEEL +5 -0
- aimodelshare-0.3.7.dist-info/licenses/LICENSE +5 -0
- aimodelshare-0.3.7.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
FROM public.ecr.aws/lambda/python:$python_version
|
|
2
|
+
|
|
3
|
+
RUN yum -y install java-1.8.0-openjdk
|
|
4
|
+
|
|
5
|
+
COPY $requirements_file_path ./
|
|
6
|
+
|
|
7
|
+
RUN pip install -r ./requirements.txt
|
|
8
|
+
|
|
9
|
+
ENV SPARK_HOME="/var/lang/lib/python$python_version/site-packages/pyspark"
|
|
10
|
+
ENV PATH=$PATH:$SPARK_HOME/bin
|
|
11
|
+
ENV PATH=$PATH:$SPARK_HOME/sbin
|
|
12
|
+
ENV PYTHONPATH=$SPARK_HOME/python:$SPARK_HOME/python/lib/py4j-0.10.9-src.zip:$PYTHONPATH
|
|
13
|
+
ENV PATH=$SPARK_HOME/python:$PATH
|
|
14
|
+
ENV SPARK_MASTER_HOST="localhost"
|
|
15
|
+
ENV SPARK_LOCAL_IP="127.0.0.1"
|
|
16
|
+
|
|
17
|
+
ENV JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk*/jre"
|
|
18
|
+
ENV PATH=$PATH:$JAVA_HOME/bin
|
|
19
|
+
|
|
20
|
+
COPY spark-class $SPARK_HOME/bin/
|
|
21
|
+
RUN chmod +x $SPARK_HOME/bin/spark-class
|
|
22
|
+
|
|
23
|
+
CMD ["lambda_function.lambda_handler"]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
version: 0.2
|
|
2
|
+
|
|
3
|
+
phases:
|
|
4
|
+
pre_build:
|
|
5
|
+
commands:
|
|
6
|
+
- aws ecr get-login-password --region $region | docker login --username AWS --password-stdin $account_id.dkr.ecr.$region.amazonaws.com
|
|
7
|
+
build:
|
|
8
|
+
commands:
|
|
9
|
+
- docker build --label $label --tag $repository:$image_tag .
|
|
10
|
+
- docker tag $repository:$image_tag $account_id.dkr.ecr.$region.amazonaws.com/$repository:$image_tag
|
|
11
|
+
- docker push $account_id.dkr.ecr.$region.amazonaws.com/$repository:$image_tag
|
|
12
|
+
post_build:
|
|
13
|
+
commands:
|
|
14
|
+
- echo Build Successful.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# SET ENVIRONMENT VARIALBES FOR BUCKETS
|
|
2
|
+
|
|
3
|
+
# "bucket": "aimodehshare",
|
|
4
|
+
# "api_id": "354mdp3021",
|
|
5
|
+
# "function_name": "modfunction161070"
|
|
6
|
+
|
|
7
|
+
import sys
|
|
8
|
+
import os
|
|
9
|
+
import json
|
|
10
|
+
import zipfile
|
|
11
|
+
import tempfile
|
|
12
|
+
import boto3
|
|
13
|
+
|
|
14
|
+
temp_path = tempfile.gettempdir()
|
|
15
|
+
|
|
16
|
+
bucket = os.getenv("bucket")
|
|
17
|
+
api_id = os.getenv("api_id")
|
|
18
|
+
function_name = os.getenv("function_name")
|
|
19
|
+
|
|
20
|
+
key = api_id + "/" + function_name + ".zip"
|
|
21
|
+
temp_path_directory = "/".join([temp_path, function_name])
|
|
22
|
+
temp_path_directory_zip_file = temp_path_directory + ".zip"
|
|
23
|
+
|
|
24
|
+
s3_client = boto3.client('s3')
|
|
25
|
+
response = s3_client.download_file(
|
|
26
|
+
bucket,
|
|
27
|
+
key,
|
|
28
|
+
temp_path_directory_zip_file
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
with zipfile.ZipFile(temp_path_directory_zip_file, 'r') as zip_ref:
|
|
32
|
+
zip_ref.extractall(temp_path)
|
|
33
|
+
|
|
34
|
+
sys.path.append(temp_path)
|
|
35
|
+
from model import handler
|
|
36
|
+
|
|
37
|
+
def lambda_handler(event, context):
|
|
38
|
+
print("lambda_handler from containerization_templates")
|
|
39
|
+
result = handler(event, context)
|
|
40
|
+
return result
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from model import handler
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
def lambda_handler(event, context):
|
|
6
|
+
|
|
7
|
+
return {
|
|
8
|
+
"statusCode": 200,
|
|
9
|
+
"headers": {
|
|
10
|
+
"Access-Control-Allow-Origin" : "*",
|
|
11
|
+
"Access-Control-Allow-Credentials": True,
|
|
12
|
+
"Allow" : "GET, OPTIONS, POST",
|
|
13
|
+
"Access-Control-Allow-Methods" : "GET, OPTIONS, POST",
|
|
14
|
+
"Access-Control-Allow-Headers" : "*"
|
|
15
|
+
},
|
|
16
|
+
"body" : json.dumps(handler(event, context))
|
|
17
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import zipfile
|
|
3
|
+
import sys
|
|
4
|
+
import pickle
|
|
5
|
+
import tempfile
|
|
6
|
+
import dill
|
|
7
|
+
import importlib
|
|
8
|
+
import inspect
|
|
9
|
+
#from aimodelshare.python.my_preprocessor import *
|
|
10
|
+
|
|
11
|
+
def export_eval_metric(eval_metric_fxn, directory, name='eval_metric', globs=globals()):
|
|
12
|
+
"""
|
|
13
|
+
Exports evaluation metric and related objects into zip file for model deployment
|
|
14
|
+
Inputs: 2
|
|
15
|
+
Output: zipfile named 'eval_metric.zip'
|
|
16
|
+
|
|
17
|
+
Parameters:
|
|
18
|
+
-----------
|
|
19
|
+
`eval_metric_fxn`: name of eval metric function
|
|
20
|
+
`directory`: ``string`` folderpath to eval metric function
|
|
21
|
+
use "" to reference current working directory
|
|
22
|
+
`name`: name of the custom eval metric
|
|
23
|
+
|
|
24
|
+
Returns:
|
|
25
|
+
--------
|
|
26
|
+
file named 'name.zip' in the correct format for model deployment
|
|
27
|
+
"""
|
|
28
|
+
#evaluation metric fxn should always be named "eval_metric" to work properly in aimodelshare process.
|
|
29
|
+
|
|
30
|
+
try:
|
|
31
|
+
import tempfile
|
|
32
|
+
from zipfile import ZipFile
|
|
33
|
+
import inspect
|
|
34
|
+
import os
|
|
35
|
+
|
|
36
|
+
globals().update(eval_metric_fxn.__globals__)
|
|
37
|
+
|
|
38
|
+
folderpath=directory
|
|
39
|
+
|
|
40
|
+
#create temporary folder
|
|
41
|
+
temp_dir=tempfile.gettempdir()
|
|
42
|
+
try:
|
|
43
|
+
os.remove(os.path.join(folderpath, name+".zip"))
|
|
44
|
+
except:
|
|
45
|
+
pass
|
|
46
|
+
#save function code within temporary folder
|
|
47
|
+
source = inspect.getsource(eval_metric_fxn)
|
|
48
|
+
with open(os.path.join(temp_dir,"{}.py".format(name)), "w") as f:
|
|
49
|
+
f.write(source)
|
|
50
|
+
|
|
51
|
+
# create a ZipFile object
|
|
52
|
+
zipObj = ZipFile(os.path.join(folderpath,"{}.zip".format(name)), 'w')
|
|
53
|
+
# Add preprocessor function to the zipfile
|
|
54
|
+
zipObj.write(os.path.join(temp_dir,"{}.py".format(name)),"{}.py".format(name))
|
|
55
|
+
|
|
56
|
+
#getting list of global variables used in function
|
|
57
|
+
|
|
58
|
+
import inspect
|
|
59
|
+
function_objects=list(inspect.getclosurevars(eval_metric_fxn).globals.keys())
|
|
60
|
+
|
|
61
|
+
import sys
|
|
62
|
+
modulenames = ["sklearn","keras","tensorflow","cv2","resize","pytorch", "librosa"]
|
|
63
|
+
function_objects_nomodules = [i for i in function_objects if i not in list(modulenames)]
|
|
64
|
+
|
|
65
|
+
def savetopickle(function_objects_listelement):
|
|
66
|
+
import pickle
|
|
67
|
+
pickle.dump(globals()[function_objects_listelement], open( os.path.join(temp_dir,function_objects_listelement+".pkl"), "wb" ) )
|
|
68
|
+
return function_objects_listelement
|
|
69
|
+
|
|
70
|
+
savedevalmetricobjectslist = list(map(savetopickle, function_objects_nomodules))
|
|
71
|
+
|
|
72
|
+
# take savedpreprocessorobjectslist pkl files saved to tempdir to zipfile
|
|
73
|
+
import pickle
|
|
74
|
+
import string
|
|
75
|
+
|
|
76
|
+
for i in savedevalmetricobjectslist:
|
|
77
|
+
objectname=str(i)+".pkl"
|
|
78
|
+
zipObj.write(os.path.join(temp_dir,objectname),objectname)
|
|
79
|
+
|
|
80
|
+
# close the Zip File
|
|
81
|
+
zipObj.close()
|
|
82
|
+
|
|
83
|
+
try:
|
|
84
|
+
# clean up temp directory files for future runs
|
|
85
|
+
os.remove(os.path.join(temp_dir,"{}.py".format(name)))
|
|
86
|
+
|
|
87
|
+
for i in savedevalmetricobjectslist:
|
|
88
|
+
objectname=str(i)+".pkl"
|
|
89
|
+
os.remove(os.path.join(temp_dir,objectname))
|
|
90
|
+
except:
|
|
91
|
+
pass
|
|
92
|
+
|
|
93
|
+
except Exception as e:
|
|
94
|
+
print(e)
|
|
95
|
+
|
|
96
|
+
return print("Your eval_metric is now saved to '{}.zip'".format(name))
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
__all__ = [
|
|
101
|
+
export_eval_metric
|
|
102
|
+
]
|
|
103
|
+
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
version: 0.2
|
|
2
|
+
|
|
3
|
+
phases:
|
|
4
|
+
pre_build:
|
|
5
|
+
commands:
|
|
6
|
+
- aws configure set aws_access_key_id $aws_access_key_id
|
|
7
|
+
- aws configure set aws_secret_access_key $aws_secret_access_key
|
|
8
|
+
- aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
|
|
9
|
+
build:
|
|
10
|
+
commands:
|
|
11
|
+
- docker build -t $repository:$dataset_tag .
|
|
12
|
+
- docker tag $repository:$dataset_tag $registry_uri/$repository:$dataset_tag
|
|
13
|
+
post_build:
|
|
14
|
+
commands:
|
|
15
|
+
- docker push $registry_uri/$repository:$dataset_tag
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Version": "2012-10-17",
|
|
3
|
+
"Statement": [
|
|
4
|
+
{
|
|
5
|
+
"Effect": "Allow",
|
|
6
|
+
"Resource": "*",
|
|
7
|
+
"Action": [
|
|
8
|
+
"logs:CreateLogGroup",
|
|
9
|
+
"logs:CreateLogStream",
|
|
10
|
+
"logs:PutLogEvents"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"Effect": "Allow",
|
|
15
|
+
"Resource": "*",
|
|
16
|
+
"Action": [
|
|
17
|
+
"s3:PutObject",
|
|
18
|
+
"s3:GetObject",
|
|
19
|
+
"s3:GetObjectVersion",
|
|
20
|
+
"s3:GetBucketAcl",
|
|
21
|
+
"s3:GetBucketLocation"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"Effect": "Allow",
|
|
26
|
+
"Action": [
|
|
27
|
+
"codebuild:CreateReportGroup",
|
|
28
|
+
"codebuild:CreateReport",
|
|
29
|
+
"codebuild:UpdateReport",
|
|
30
|
+
"codebuild:BatchPutTestCases",
|
|
31
|
+
"codebuild:BatchPutCodeCoverages"
|
|
32
|
+
],
|
|
33
|
+
"Resource": "*"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"Effect": "Allow",
|
|
37
|
+
"Action": [
|
|
38
|
+
"ecr:*",
|
|
39
|
+
"cloudtrail:LookupEvents"
|
|
40
|
+
],
|
|
41
|
+
"Resource": "*"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"Effect": "Allow",
|
|
45
|
+
"Action": [
|
|
46
|
+
"iam:CreateServiceLinkedRole"
|
|
47
|
+
],
|
|
48
|
+
"Resource": "*",
|
|
49
|
+
"Condition": {
|
|
50
|
+
"StringEquals": {
|
|
51
|
+
"iam:AWSServiceName": [
|
|
52
|
+
"replication.ecr.amazonaws.com"
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"Effect": "Allow",
|
|
59
|
+
"Action": [
|
|
60
|
+
"cloudformation:*"
|
|
61
|
+
],
|
|
62
|
+
"Resource": "*"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"Effect": "Allow",
|
|
66
|
+
"Action": [
|
|
67
|
+
"cloudformation:DescribeStacks",
|
|
68
|
+
"cloudformation:ListStackResources",
|
|
69
|
+
"cloudwatch:ListMetrics",
|
|
70
|
+
"cloudwatch:GetMetricData",
|
|
71
|
+
"ec2:DescribeSecurityGroups",
|
|
72
|
+
"ec2:DescribeSubnets",
|
|
73
|
+
"ec2:DescribeVpcs",
|
|
74
|
+
"kms:ListAliases",
|
|
75
|
+
"iam:GetPolicy",
|
|
76
|
+
"iam:GetPolicyVersion",
|
|
77
|
+
"iam:GetRole",
|
|
78
|
+
"iam:GetRolePolicy",
|
|
79
|
+
"iam:ListAttachedRolePolicies",
|
|
80
|
+
"iam:ListRolePolicies",
|
|
81
|
+
"iam:ListRoles",
|
|
82
|
+
"lambda:*",
|
|
83
|
+
"logs:DescribeLogGroups",
|
|
84
|
+
"states:DescribeStateMachine",
|
|
85
|
+
"states:ListStateMachines",
|
|
86
|
+
"tag:GetResources",
|
|
87
|
+
"xray:GetTraceSummaries",
|
|
88
|
+
"xray:BatchGetTraces"
|
|
89
|
+
],
|
|
90
|
+
"Resource": "*"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"Effect": "Allow",
|
|
94
|
+
"Action": "iam:PassRole",
|
|
95
|
+
"Resource": "*",
|
|
96
|
+
"Condition": {
|
|
97
|
+
"StringEquals": {
|
|
98
|
+
"iam:PassedToService": "lambda.amazonaws.com"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"Effect": "Allow",
|
|
104
|
+
"Action": [
|
|
105
|
+
"logs:DescribeLogStreams",
|
|
106
|
+
"logs:GetLogEvents",
|
|
107
|
+
"logs:FilterLogEvents"
|
|
108
|
+
],
|
|
109
|
+
"Resource": "arn:aws:logs:*:*:log-group:/aws/lambda/*"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"Effect": "Allow",
|
|
113
|
+
"Action": [
|
|
114
|
+
"iam:*",
|
|
115
|
+
"organizations:DescribeAccount",
|
|
116
|
+
"organizations:DescribeOrganization",
|
|
117
|
+
"organizations:DescribeOrganizationalUnit",
|
|
118
|
+
"organizations:DescribePolicy",
|
|
119
|
+
"organizations:ListChildren",
|
|
120
|
+
"organizations:ListParents",
|
|
121
|
+
"organizations:ListPoliciesForTarget",
|
|
122
|
+
"organizations:ListRoots",
|
|
123
|
+
"organizations:ListPolicies",
|
|
124
|
+
"organizations:ListTargetsForPolicy"
|
|
125
|
+
],
|
|
126
|
+
"Resource": "*"
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
}
|