Skip to content

create_field_level_encryption_config

create_field_level_encryption_config(
    field_level_encryption_config: FieldLevelEncryptionConfig,
    *,
    config_overrides: Optional[CloudFrontClientConfig] = None,
) -> CreateFieldLevelEncryptionConfigResult

Create a new field-level encryption configuration.

Parameters:

  • field_level_encryption_config (FieldLevelEncryptionConfig) –

    The request to create a new field-level encryption configuration.

Raises:

Source code in docs_src/capo_cloudfront/_services/cloud_front.py
def create_field_level_encryption_config(
    self,
    field_level_encryption_config: "capo_cloudfront.types.field_level_encryption_config.FieldLevelEncryptionConfig",
    *,
    config_overrides: Optional[CloudFrontClientConfig] = None,
) -> "capo_cloudfront.types.create_field_level_encryption_config_result.CreateFieldLevelEncryptionConfigResult":
    """<p>Create a new field-level encryption configuration.</p>

    Args:
        field_level_encryption_config: <p>The request to create a new field-level encryption configuration.</p>

    Raises:
        capo_cloudfront.errors.field_level_encryption_config_already_exists.FieldLevelEncryptionConfigAlreadyExists: <p>The specified configuration for field-level encryption already exists.</p>
        capo_cloudfront.errors.inconsistent_quantities.InconsistentQuantities: <p>The value of <code>Quantity</code> and the size of <code>Items</code> don't match.</p>
        capo_cloudfront.errors.invalid_argument.InvalidArgument: <p>An argument is invalid.</p>
        capo_cloudfront.errors.no_such_field_level_encryption_profile.NoSuchFieldLevelEncryptionProfile: <p>The specified profile for field-level encryption doesn't exist.</p>
        capo_cloudfront.errors.query_arg_profile_empty.QueryArgProfileEmpty: <p>No profile specified for the field-level encryption query argument.</p>
        capo_cloudfront.errors.too_many_field_level_encryption_configs.TooManyFieldLevelEncryptionConfigs: <p>The maximum number of configurations for field-level encryption have been created.</p>
        capo_cloudfront.errors.too_many_field_level_encryption_content_type_profiles.TooManyFieldLevelEncryptionContentTypeProfiles: <p>The maximum number of content type profiles for field-level encryption have been created.</p>
        capo_cloudfront.errors.too_many_field_level_encryption_query_arg_profiles.TooManyFieldLevelEncryptionQueryArgProfiles: <p>The maximum number of query arg profiles for field-level encryption have been created.</p>
        capo_cloudfront.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cloudfront.types.create_field_level_encryption_config_request.CreateFieldLevelEncryptionConfigRequest]",
    ) -> OperationResponse[
        "capo_cloudfront.types.create_field_level_encryption_config_result.CreateFieldLevelEncryptionConfigResult"
    ]:
        import capo_cloudfront._operations.cloudfront2020_05_31.create_field_level_encryption_config

        output, http_response = (
            capo_cloudfront._operations.cloudfront2020_05_31.create_field_level_encryption_config.create_field_level_encryption_config(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateFieldLevelEncryptionConfig")
    )
    input_: capo_cloudfront.types.create_field_level_encryption_config_request.CreateFieldLevelEncryptionConfigRequest = {
        "field_level_encryption_config": field_level_encryption_config
    }

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