Skip to content

create_profile_entry async

create_profile_entry(
    profile_identifier: Identifier,
    extension_identifier: ExtensionId,
    *,
    config_overrides: Optional[AsyncCloudExtensionsClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    name: Optional[Name] = None,
    description: Optional[Description_256] = None,
    interfaces: Optional[InterfaceOptionsMap] = None,
    execution_role: Optional[RoleArn] = None,
    version_policy: Optional[VersionPolicy] = None,
    settings: Optional[Settings] = None,
    approve: Optional[CapabilityPathList] = None,
    tags: Optional[TagMap] = None,
) -> CreateProfileEntryOutput

Creates a profile entry that binds an extension to a profile. The extension must exist and the profile must not already have an entry for that extension.

Parameters:

  • profile_identifier (Identifier) –

    The identifier (id or name) of the profile to bind the extension to.

  • extension_identifier (ExtensionId) –

    The id of the extension to bind, such as aws:secretsmanager.

  • name (Optional[Name], default: None ) –

    The entry's name, unique within the profile. Defaults to the name in the extension's id.

  • description (Optional[Description_256], default: None ) –

    A description of the entry's purpose.

  • interfaces (Optional[InterfaceOptionsMap], default: None ) –

    Per-interface options, keyed by the id of an interface the extension declares.

  • execution_role (Optional[RoleArn], default: None ) –

    The IAM role an extension assumes when calling AWS services. The role must be assumable by the Cloud Extensions Runtime's principal.

  • version_policy (Optional[VersionPolicy], default: None ) –

    Controls which extension version this entry tracks and how it adopts new releases.

  • settings (Optional[Settings], default: None ) –

    The setting values to use for this extension, as free-form JSON. Keys are the extension's setting ids and the values are validated against the extension's settings definitions. A setting that is omitted or null takes its default, if it has one. A null inside an array is rejected.

  • approve (Optional[CapabilityPathList], default: None ) –

    A list of capability paths to approve. Each path must correspond to a capability instance declared by the extension.

  • tags (Optional[TagMap], default: None ) –

    Tags to assign to the profile entry.

Raises:

Source code in docs_src/capo_cloudextensions/_services/async_cloud_extensions.py
async def create_profile_entry(
    self,
    profile_identifier: "capo_cloudextensions.types.identifier.Identifier",
    extension_identifier: "capo_cloudextensions.types.extension_id.ExtensionId",
    *,
    config_overrides: Optional[AsyncCloudExtensionsClientConfig] = None,
    client_token: Optional[
        "capo_cloudextensions.types.client_token.ClientToken"
    ] = None,
    name: Optional["capo_cloudextensions.types.name.Name"] = None,
    description: Optional[
        "capo_cloudextensions.types.description_256.Description_256"
    ] = None,
    interfaces: Optional[
        "capo_cloudextensions.types.interface_options_map.InterfaceOptionsMap"
    ] = None,
    execution_role: Optional["capo_cloudextensions.types.role_arn.RoleArn"] = None,
    version_policy: Optional[
        "capo_cloudextensions.types.version_policy.VersionPolicy"
    ] = None,
    settings: Optional["capo_cloudextensions.types.settings.Settings"] = None,
    approve: Optional[
        "capo_cloudextensions.types.capability_path_list.CapabilityPathList"
    ] = None,
    tags: Optional["capo_cloudextensions.types.tag_map.TagMap"] = None,
) -> "capo_cloudextensions.types.create_profile_entry_output.CreateProfileEntryOutput":
    """Creates a profile entry that binds an extension to a profile. The extension must exist and the profile must not already have an entry for that extension.

    Args:
        profile_identifier: The identifier (id or name) of the profile to bind the extension to.
        extension_identifier: The id of the extension to bind, such as aws:secretsmanager.
        name: The entry's name, unique within the profile. Defaults to the name in the extension's id.
        description: A description of the entry's purpose.
        interfaces: Per-interface options, keyed by the id of an interface the extension declares.
        execution_role: The IAM role an extension assumes when calling AWS services. The role must be assumable by the Cloud Extensions Runtime's principal.
        version_policy: Controls which extension version this entry tracks and how it adopts new releases.
        settings: The setting values to use for this extension, as free-form JSON. Keys are the extension's setting ids and the values are validated against the extension's settings definitions. A setting that is omitted or null takes its default, if it has one. A null inside an array is rejected.
        approve: A list of capability paths to approve. Each path must correspond to a capability instance declared by the extension.
        tags: Tags to assign to the profile entry.

    Raises:
        capo_cloudextensions.errors.access_denied_exception.AccessDeniedException: The caller does not have permission to perform the operation.
        capo_cloudextensions.errors.internal_server_exception.InternalServerException: The service couldn't process the request because of an internal error. Retry with capped exponential backoff and jitter.
        capo_cloudextensions.errors.throttling_exception.ThrottlingException: The request rate exceeded a limit. Retry with capped exponential backoff and jitter.
        capo_cloudextensions.errors.conflict_exception.ConflictException: The request conflicts with the current state of the resource.
        capo_cloudextensions.errors.resource_not_found_exception.ResourceNotFoundException: The specified resource does not exist or the caller does not have permission to access it.
        capo_cloudextensions.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: The request would exceed a service quota for the account.
        capo_cloudextensions.errors.validation_exception.ValidationException: The request was malformed or contained invalid parameter values.
        capo_cloudextensions.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudextensions.types.create_profile_entry_input.CreateProfileEntryInput]",
    ) -> AsyncOperationResponse[
        "capo_cloudextensions.types.create_profile_entry_output.CreateProfileEntryOutput"
    ]:
        import capo_cloudextensions._operations.control_plane.create_profile_entry

        (
            output,
            http_response,
        ) = await capo_cloudextensions._operations.control_plane.create_profile_entry.async_create_profile_entry(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_cloudextensions.types.create_profile_entry_input.CreateProfileEntryInput",
    ) -> dict[str, Any]:
        import capo_cloudextensions.types.create_profile_entry_input

        return (
            capo_cloudextensions.types.create_profile_entry_input.redact_sensitive(
                input_
            )
        )

    def _redact_output(
        output: "capo_cloudextensions.types.create_profile_entry_output.CreateProfileEntryOutput",
    ) -> dict[str, Any]:
        import capo_cloudextensions.types.create_profile_entry_output

        return (
            capo_cloudextensions.types.create_profile_entry_output.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateProfileEntry",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_cloudextensions.types.create_profile_entry_input.CreateProfileEntryInput = {
        "profile_identifier": profile_identifier,
        "extension_identifier": extension_identifier,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if interfaces is not None:
        input_["interfaces"] = interfaces
    if execution_role is not None:
        input_["execution_role"] = execution_role
    if version_policy is not None:
        input_["version_policy"] = version_policy
    if settings is not None:
        input_["settings"] = settings
    if approve is not None:
        input_["approve"] = approve
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output