create_environment
¶
create_environment(
environment_name: EnvironmentName,
*,
config_overrides: Optional[AssuranceClientConfig] = None,
description: Optional[EnvironmentDescription] = None,
domain_prefix: Optional[DomainPrefix] = None,
operator_role: Optional[IamRoleArn] = None,
identity_store: Optional[IdentityStoreConfig] = None,
kms_key_arn: Optional[KmsKeyArn] = None,
regions: Optional[RegionList] = None,
environment_scope: Optional[EnvironmentScope] = None,
organizational_unit_ids: Optional[OrganizationalUnitIdList] = None,
tags: Optional[TagList] = None,
) -> CreateEnvironmentOutput
Creates a new governance environment with the specified name and service role. If you provide identityStore, AWS Assurance creates an IAM Identity Center managed application for the environment.
Parameters:
-
environment_name(EnvironmentName) –The name of the environment.
-
description(Optional[EnvironmentDescription], default:None) –A description of the environment.
-
domain_prefix(Optional[DomainPrefix], default:None) –The optional custom domain prefix for the environment portal URL. The prefix must be unique within the AWS Region. If you don't specify a prefix, AWS Assurance uses the environment ID. You can't change the prefix after you create the environment.
-
operator_role(Optional[IamRoleArn], default:None) –The AWS Identity and Access Management (IAM) role that AWS Assurance assumes to issue temporary credentials to operators who use your application. You must specify this role to support operator sessions. The role's trust policy must allow the AWS Assurance service principal to call
sts:AssumeRole. -
identity_store(Optional[IdentityStoreConfig], default:None) –The identity store configuration.
-
kms_key_arn(Optional[KmsKeyArn], default:None) –The ARN of an optional AWS KMS key that encrypts evidence. The AWS Assurance service role must have
kms:Decryptandkms:GenerateDataKeypermissions on this key. -
regions(Optional[RegionList], default:None) –The AWS Regions to evaluate across. When empty or omitted, the environment evaluates all generally available Regions in the partition. Applies to all accounts in scope.
-
environment_scope(Optional[EnvironmentScope], default:None) –The set of AWS accounts that the new environment evaluates. If you omit the scope, AWS Assurance uses
SINGLE_ACCOUNT. Valid values:-
ORGANIZATION– Evaluates the member accounts in your organization in AWS Organizations. Call this operation from the management account or a delegated administrator account, with trusted access for AWS Assurance turned on. -
SINGLE_ACCOUNT– Evaluates only the account where you create the environment.
-
-
organizational_unit_ids(Optional[OrganizationalUnitIdList], default:None) –The organizational units to scope the organization environment's evaluation to. Only valid when the environment scope is ORGANIZATION. When omitted, the entire organization is in scope. Must contain at least one OU when provided. Accounts in nested OUs under a listed OU are included.
-
tags(Optional[TagList], default:None) –The tags attached to the resource, as key-value pairs.
Raises:
-
AccessDeniedException–You do not have sufficient access to perform this action. This error occurs when the request is unauthenticated, or is authenticated but lacks permission to invoke the operation.
-
ConflictException–A conflict occurred (for example, resource already exists).
-
InternalServerException–An internal server error occurred.
-
ThrottlingException–The request was throttled.
-
ValidationException–The request failed validation.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Create a governance environment Creates a single-account governance environment for the payments team to run its PCI-DSS assessment.
>>> client.create_environment(environment_name='payments-governance', description="Governance environment for the payments team's PCI-DSS assessment.", domain_prefix='payments-prod', environment_scope='SINGLE_ACCOUNT')
Source code in docs_src/capo_assurance/_services/assurance.py
1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 | |