AppConfig / Client / create_configuration_profile

create_configuration_profile#

AppConfig.Client.create_configuration_profile(**kwargs)#

Creates a configuration profile, which is information that enables AppConfig to access the configuration source. Valid configuration sources include the following:

  • Configuration data in YAML, JSON, and other formats stored in the AppConfig hosted configuration store

  • Configuration data stored as objects in an Amazon Simple Storage Service (Amazon S3) bucket

  • Pipelines stored in CodePipeline

  • Secrets stored in Secrets Manager

  • Standard and secure string parameters stored in Amazon Web Services Systems Manager Parameter Store

  • Configuration data in SSM documents stored in the Systems Manager document store

A configuration profile includes the following information:

  • The URI location of the configuration data.

  • The Identity and Access Management (IAM) role that provides access to the configuration data.

  • A validator for the configuration data. Available validators include either a JSON Schema or an Amazon Web Services Lambda function.

For more information, see Create a Configuration and a Configuration Profile in the AppConfig User Guide.

See also: AWS API Documentation

Request Syntax

response = client.create_configuration_profile(
    ApplicationId='string',
    Name='string',
    Description='string',
    LocationUri='string',
    RetrievalRoleArn='string',
    Validators=[
        {
            'Type': 'JSON_SCHEMA'|'LAMBDA',
            'Content': 'string'
        },
    ],
    Tags={
        'string': 'string'
    },
    Type='string'
)
Parameters:
  • ApplicationId (string) –

    [REQUIRED]

    The application ID.

  • Name (string) –

    [REQUIRED]

    A name for the configuration profile.

  • Description (string) – A description of the configuration profile.

  • LocationUri (string) –

    [REQUIRED]

    A URI to locate the configuration. You can specify the following:

    • For the AppConfig hosted configuration store and for feature flags, specify hosted.

    • For an Amazon Web Services Systems Manager Parameter Store parameter, specify either the parameter name in the format ssm-parameter://<parameter name> or the ARN.

    • For an Secrets Manager secret, specify the URI in the following format: secrets-manager://<secret name>.

    • For an Amazon S3 object, specify the URI in the following format: s3://<bucket>/<objectKey> ``. Here is an example: ``s3://my-bucket/my-app/us-east-1/my-config.json

    • For an SSM document, specify either the document name in the format ssm-document://<document name> or the Amazon Resource Name (ARN).

  • RetrievalRoleArn (string) –

    The ARN of an IAM role with permission to access the configuration at the specified LocationUri.

    Warning

    A retrieval role ARN is not required for configurations stored in the AppConfig hosted configuration store. It is required for all other sources that store your configuration.

  • Validators (list) –

    A list of methods for validating the configuration.

    • (dict) –

      A validator provides a syntactic or semantic check to ensure the configuration that you want to deploy functions as intended. To validate your application configuration data, you provide a schema or an Amazon Web Services Lambda function that runs against the configuration. The configuration deployment or update can only proceed when the configuration data is valid.

      • Type (string) – [REQUIRED]

        AppConfig supports validators of type JSON_SCHEMA and LAMBDA

      • Content (string) – [REQUIRED]

        Either the JSON Schema content or the Amazon Resource Name (ARN) of an Lambda function.

  • Tags (dict) –

    Metadata to assign to the configuration profile. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.

    • (string) –

      • (string) –

  • Type (string) –

    The type of configurations contained in the profile. AppConfig supports feature flags and freeform configurations. We recommend you create feature flag configurations to enable or disable new features and freeform configurations to distribute configurations to an application. When calling this API, enter one of the following values for Type:

    AWS.AppConfig.FeatureFlags

    AWS.Freeform

Return type:

dict

Returns:

Response Syntax

{
    'ApplicationId': 'string',
    'Id': 'string',
    'Name': 'string',
    'Description': 'string',
    'LocationUri': 'string',
    'RetrievalRoleArn': 'string',
    'Validators': [
        {
            'Type': 'JSON_SCHEMA'|'LAMBDA',
            'Content': 'string'
        },
    ],
    'Type': 'string'
}

Response Structure

  • (dict) –

    • ApplicationId (string) –

      The application ID.

    • Id (string) –

      The configuration profile ID.

    • Name (string) –

      The name of the configuration profile.

    • Description (string) –

      The configuration profile description.

    • LocationUri (string) –

      The URI location of the configuration.

    • RetrievalRoleArn (string) –

      The ARN of an IAM role with permission to access the configuration at the specified LocationUri.

    • Validators (list) –

      A list of methods for validating the configuration.

      • (dict) –

        A validator provides a syntactic or semantic check to ensure the configuration that you want to deploy functions as intended. To validate your application configuration data, you provide a schema or an Amazon Web Services Lambda function that runs against the configuration. The configuration deployment or update can only proceed when the configuration data is valid.

        • Type (string) –

          AppConfig supports validators of type JSON_SCHEMA and LAMBDA

        • Content (string) –

          Either the JSON Schema content or the Amazon Resource Name (ARN) of an Lambda function.

    • Type (string) –

      The type of configurations contained in the profile. AppConfig supports feature flags and freeform configurations. We recommend you create feature flag configurations to enable or disable new features and freeform configurations to distribute configurations to an application. When calling this API, enter one of the following values for Type:

      AWS.AppConfig.FeatureFlags

      AWS.Freeform

Exceptions

  • AppConfig.Client.exceptions.BadRequestException

  • AppConfig.Client.exceptions.ResourceNotFoundException

  • AppConfig.Client.exceptions.InternalServerException

Examples

The following create-configuration-profile example creates a configuration profile using a configuration stored in Parameter Store, a capability of Systems Manager.

response = client.create_configuration_profile(
    ApplicationId='339ohji',
    LocationUri='ssm-parameter://Example-Parameter',
    Name='Example-Configuration-Profile',
    RetrievalRoleArn='arn:aws:iam::111122223333:role/Example-App-Config-Role',
)

print(response)

Expected Output:

{
    'ApplicationId': '339ohji',
    'Id': 'ur8hx2f',
    'LocationUri': 'ssm-parameter://Example-Parameter',
    'Name': 'Example-Configuration-Profile',
    'RetrievalRoleArn': 'arn:aws:iam::111122223333:role/Example-App-Config-Role',
    'ResponseMetadata': {
        '...': '...',
    },
}