ResilienceHubV2 / Client / create_input_source

create_input_source

ResilienceHubV2.Client.create_input_source(**kwargs)

Creates an input source for a service.

See also: AWS API Documentation

Request Syntax

response = client.create_input_source(
    serviceArn='string',
    resourceConfiguration={
        'resourceTags': [
            {
                'key': 'string',
                'values': [
                    'string',
                ]
            },
        ],
        'cfnStackArn': 'string',
        'tfStateFileUrl': 'string',
        'eks': {
            'clusterArn': 'string',
            'namespaces': [
                'string',
            ],
            'labelSelector': {
                'matchLabels': {
                    'string': 'string'
                },
                'matchExpressions': [
                    {
                        'key': 'string',
                        'operator': 'IN'|'NOT_IN'|'EXISTS'|'DOES_NOT_EXIST',
                        'values': [
                            'string',
                        ]
                    },
                ]
            }
        },
        'designFileS3Url': 'string'
    },
    clientToken='string'
)
Parameters:
  • serviceArn (string) –

    [REQUIRED]

    ARN identifier.

  • resourceConfiguration (dict) –

    [REQUIRED]

    Resource configuration for an input source. Provide exactly one field.

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: resourceTags, cfnStackArn, tfStateFileUrl, eks, designFileS3Url.

    • resourceTags (list) –

      The resource tags for tag-based resource discovery.

      • (dict) –

        A tag key-value pair used for resource discovery.

        • key (string) – [REQUIRED]

          Tag key.

        • values (list) – [REQUIRED]

          The list of tag values.

          • (string) –

            Tag value.

    • cfnStackArn (string) –

      ARN identifier.

    • tfStateFileUrl (string) –

      S3 URL — virtual hosted-style or s3:// URI.

    • eks (dict) –

      The Amazon EKS configuration for resource discovery.

      • clusterArn (string) – [REQUIRED]

        ARN identifier.

      • namespaces (list) – [REQUIRED]

        The list of Kubernetes namespaces within the EKS cluster.

        • (string) –

          Kubernetes namespace name (RFC 1123 Label).

      • labelSelector (dict) –

        Filters discovery to the Kubernetes objects whose labels match the selector. When omitted, all supported objects in the specified namespaces are discovered.

        • matchLabels (dict) –

          The label key-value pairs that an object must have. All pairs must match for the object to be selected.

          • (string) –

            A Kubernetes label key. It can include an optional DNS subdomain prefix.

            • (string) –

              A Kubernetes label value. This value can be empty.

        • matchExpressions (list) –

          The label requirements that an object must satisfy. All requirements in the list must match for the object to be selected.

          • (dict) –

            A single label requirement in a label selector, expressed as a key, an operator, and an optional list of values.

            • key (string) – [REQUIRED]

              The label key that the requirement applies to.

            • operator (string) – [REQUIRED]

              The operator that relates the label key to the values.

            • values (list) –

              The label values to compare against. Specify values when the operator is IN or NOT_IN. Leave this empty when the operator is EXISTS or DOES_NOT_EXIST.

              • (string) –

                A Kubernetes label value. This value can be empty.

    • designFileS3Url (string) –

      S3 URL — virtual hosted-style or s3:// URI.

  • clientToken (string) –

    Idempotency token.

    This field is autopopulated if not provided.

Return type:

dict

Returns:

Response Syntax

{
    'serviceArn': 'string',
    'inputSourceId': 'string'
}

Response Structure

  • (dict) –

    • serviceArn (string) –

      ARN identifier.

    • inputSourceId (string) –

      The unique identifier assigned to the created input source.

Exceptions