Skip to content

create_workload

create_workload(
    *,
    config_overrides: Optional[WellArchitectedClientConfig] = None,
    workload_name: Optional[WorkloadName] = None,
    description: Optional[WorkloadDescription] = None,
    environment: Optional[WorkloadEnvironment] = None,
    account_ids: Optional[WorkloadAccountIds] = None,
    aws_regions: Optional[WorkloadAwsRegions] = None,
    non_aws_regions: Optional[WorkloadNonAwsRegions] = None,
    pillar_priorities: Optional[WorkloadPillarPriorities] = None,
    architectural_design: Optional[WorkloadArchitecturalDesign] = None,
    review_owner: Optional[WorkloadReviewOwner] = None,
    industry_type: Optional[WorkloadIndustryType] = None,
    industry: Optional[WorkloadIndustry] = None,
    lenses: Optional[WorkloadLenses] = None,
    notes: Optional[Notes] = None,
    client_request_token: Optional[ClientRequestToken] = None,
    tags: Optional[TagMap] = None,
    discovery_config: Optional[WorkloadDiscoveryConfig] = None,
    applications: Optional[WorkloadApplications] = None,
    profile_arns: Optional[WorkloadProfileArns] = None,
    review_template_arns: Optional[ReviewTemplateArns] = None,
    jira_configuration: Optional[WorkloadJiraConfigurationInput] = None,
) -> CreateWorkloadOutput

Create a new workload.

The owner of a workload can share the workload with other Amazon Web Services accounts, users, an organization, and organizational units (OUs) in the same Amazon Web Services Region. Only the owner of a workload can delete it.

For more information, see Defining a Workload in the Well-Architected Tool User Guide.

Either AwsRegions, NonAwsRegions, or both must be specified when creating a workload.

You also must specify ReviewOwner, even though the parameter is listed as not being required in the following section.

When creating a workload using a review template, you must have the following IAM permissions:

  • wellarchitected:GetReviewTemplate

  • wellarchitected:GetReviewTemplateAnswer

  • wellarchitected:ListReviewTemplateAnswers

  • wellarchitected:GetReviewTemplateLensReview

Parameters:

Raises:

Source code in docs_src/capo_wellarchitected/_services/well_architected.py
def create_workload(
    self,
    *,
    config_overrides: Optional[WellArchitectedClientConfig] = None,
    workload_name: Optional[
        "capo_wellarchitected.types.workload_name.WorkloadName"
    ] = None,
    description: Optional[
        "capo_wellarchitected.types.workload_description.WorkloadDescription"
    ] = None,
    environment: Optional[
        "capo_wellarchitected.types.workload_environment.WorkloadEnvironment"
    ] = None,
    account_ids: Optional[
        "capo_wellarchitected.types.workload_account_ids.WorkloadAccountIds"
    ] = None,
    aws_regions: Optional[
        "capo_wellarchitected.types.workload_aws_regions.WorkloadAwsRegions"
    ] = None,
    non_aws_regions: Optional[
        "capo_wellarchitected.types.workload_non_aws_regions.WorkloadNonAwsRegions"
    ] = None,
    pillar_priorities: Optional[
        "capo_wellarchitected.types.workload_pillar_priorities.WorkloadPillarPriorities"
    ] = None,
    architectural_design: Optional[
        "capo_wellarchitected.types.workload_architectural_design.WorkloadArchitecturalDesign"
    ] = None,
    review_owner: Optional[
        "capo_wellarchitected.types.workload_review_owner.WorkloadReviewOwner"
    ] = None,
    industry_type: Optional[
        "capo_wellarchitected.types.workload_industry_type.WorkloadIndustryType"
    ] = None,
    industry: Optional[
        "capo_wellarchitected.types.workload_industry.WorkloadIndustry"
    ] = None,
    lenses: Optional[
        "capo_wellarchitected.types.workload_lenses.WorkloadLenses"
    ] = None,
    notes: Optional["capo_wellarchitected.types.notes.Notes"] = None,
    client_request_token: Optional[
        "capo_wellarchitected.types.client_request_token.ClientRequestToken"
    ] = None,
    tags: Optional["capo_wellarchitected.types.tag_map.TagMap"] = None,
    discovery_config: Optional[
        "capo_wellarchitected.types.workload_discovery_config.WorkloadDiscoveryConfig"
    ] = None,
    applications: Optional[
        "capo_wellarchitected.types.workload_applications.WorkloadApplications"
    ] = None,
    profile_arns: Optional[
        "capo_wellarchitected.types.workload_profile_arns.WorkloadProfileArns"
    ] = None,
    review_template_arns: Optional[
        "capo_wellarchitected.types.review_template_arns.ReviewTemplateArns"
    ] = None,
    jira_configuration: Optional[
        "capo_wellarchitected.types.workload_jira_configuration_input.WorkloadJiraConfigurationInput"
    ] = None,
) -> "capo_wellarchitected.types.create_workload_output.CreateWorkloadOutput":
    """<p>Create a new workload.</p> <p>The owner of a workload can share the workload with other Amazon Web Services accounts, users, an organization, and organizational units (OUs) in the same Amazon Web Services Region. Only the owner of a workload can delete it.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/wellarchitected/latest/userguide/define-workload.html">Defining a Workload</a> in the <i>Well-Architected Tool User Guide</i>.</p> <important> <p>Either <code>AwsRegions</code>, <code>NonAwsRegions</code>, or both must be specified when creating a workload.</p> <p>You also must specify <code>ReviewOwner</code>, even though the parameter is listed as not being required in the following section. </p> </important> <p>When creating a workload using a review template, you must have the following IAM permissions:</p> <ul> <li> <p> <code>wellarchitected:GetReviewTemplate</code> </p> </li> <li> <p> <code>wellarchitected:GetReviewTemplateAnswer</code> </p> </li> <li> <p> <code>wellarchitected:ListReviewTemplateAnswers</code> </p> </li> <li> <p> <code>wellarchitected:GetReviewTemplateLensReview</code> </p> </li> </ul>

    Args:
        tags: <p>The tags to be associated with the workload.</p>
        discovery_config: <p>Well-Architected discovery configuration settings associated to the workload.</p>
        applications: <p>List of AppRegistry application ARNs associated to the workload.</p>
        profile_arns: <p>The list of profile ARNs associated with the workload.</p>
        review_template_arns: <p>The list of review template ARNs to associate with the workload.</p>
        jira_configuration: <p>Jira configuration settings when creating a workload.</p>

    Raises:
        capo_wellarchitected.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
        capo_wellarchitected.errors.conflict_exception.ConflictException: <p>The resource has already been processed, was deleted, or is too large.</p>
        capo_wellarchitected.errors.internal_server_exception.InternalServerException: <p>There is a problem with the Well-Architected Tool API service.</p>
        capo_wellarchitected.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_wellarchitected.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The user has reached their resource quota.</p>
        capo_wellarchitected.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling.</p>
        capo_wellarchitected.errors.validation_exception.ValidationException: <p>The user input is not valid.</p>
        capo_wellarchitected.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_wellarchitected.types.create_workload_input.CreateWorkloadInput]",
    ) -> OperationResponse[
        "capo_wellarchitected.types.create_workload_output.CreateWorkloadOutput"
    ]:
        import capo_wellarchitected._operations.well_architected_api_service_lambda.create_workload

        output, http_response = (
            capo_wellarchitected._operations.well_architected_api_service_lambda.create_workload.create_workload(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateWorkload")
    )
    input_: capo_wellarchitected.types.create_workload_input.CreateWorkloadInput = {}
    if workload_name is not None:
        input_["workload_name"] = workload_name
    if description is not None:
        input_["description"] = description
    if environment is not None:
        input_["environment"] = environment
    if account_ids is not None:
        input_["account_ids"] = account_ids
    if aws_regions is not None:
        input_["aws_regions"] = aws_regions
    if non_aws_regions is not None:
        input_["non_aws_regions"] = non_aws_regions
    if pillar_priorities is not None:
        input_["pillar_priorities"] = pillar_priorities
    if architectural_design is not None:
        input_["architectural_design"] = architectural_design
    if review_owner is not None:
        input_["review_owner"] = review_owner
    if industry_type is not None:
        input_["industry_type"] = industry_type
    if industry is not None:
        input_["industry"] = industry
    if lenses is not None:
        input_["lenses"] = lenses
    if notes is not None:
        input_["notes"] = notes
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token
    if tags is not None:
        input_["tags"] = tags
    if discovery_config is not None:
        input_["discovery_config"] = discovery_config
    if applications is not None:
        input_["applications"] = applications
    if profile_arns is not None:
        input_["profile_arns"] = profile_arns
    if review_template_arns is not None:
        input_["review_template_arns"] = review_template_arns
    if jira_configuration is not None:
        input_["jira_configuration"] = jira_configuration

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output