Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aws
GitHub Repository: aws/aws-cli
Path: blob/develop/awscli/customizations/dlm/constants.py
1567 views
1
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
#
3
# Licensed under the Apache License, Version 2.0 (the "License"). You
4
# may not use this file except in compliance with the License. A copy of
5
# the License is located at
6
#
7
# http://aws.amazon.com/apache2.0/
8
#
9
# or in the "license" file accompanying this file. This file is
10
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
# ANY KIND, either express or implied. See the License for the specific
12
# language governing permissions and limitations under the License.
13
14
# Declare all the constants used by Lifecycle in this file
15
16
# Lifecycle role names
17
LIFECYCLE_DEFAULT_ROLE_NAME = "AWSDataLifecycleManagerDefaultRole"
18
LIFECYCLE_DEFAULT_ROLE_NAME_AMI = \
19
"AWSDataLifecycleManagerDefaultRoleForAMIManagement"
20
21
# Lifecycle role arn names
22
LIFECYCLE_DEFAULT_MANAGED_POLICY_NAME = "AWSDataLifecycleManagerServiceRole"
23
LIFECYCLE_DEFAULT_MANAGED_POLICY_NAME_AMI = \
24
"AWSDataLifecycleManagerServiceRoleForAMIManagement"
25
26
POLICY_ARN_PATTERN = "arn:{0}:iam::aws:policy/service-role/{1}"
27
28
# Assume Role Policy definitions for roles
29
LIFECYCLE_DEFAULT_ROLE_ASSUME_POLICY = {
30
"Version": "2012-10-17",
31
"Statement": [
32
{
33
"Sid": "",
34
"Effect": "Allow",
35
"Principal": {"Service": "dlm.amazonaws.com"},
36
"Action": "sts:AssumeRole"
37
}
38
]
39
}
40
41
RESOURCE_TYPE_SNAPSHOT = "snapshot"
42
RESOURCE_TYPE_IMAGE = "image"
43
44
RESOURCES = {
45
RESOURCE_TYPE_SNAPSHOT: {
46
'default_role_name': LIFECYCLE_DEFAULT_ROLE_NAME,
47
'default_policy_name': LIFECYCLE_DEFAULT_MANAGED_POLICY_NAME
48
},
49
RESOURCE_TYPE_IMAGE: {
50
'default_role_name': LIFECYCLE_DEFAULT_ROLE_NAME_AMI,
51
'default_policy_name': LIFECYCLE_DEFAULT_MANAGED_POLICY_NAME_AMI
52
}
53
}
54
55