CloudWatchOmni / Client / create_integration
create_integration¶
- CloudWatchOmni.Client.create_integration(**kwargs)¶
Creates an integration with a third-party provider. Returns the integration identifier and its initial status; when the provider requires interactive consent, an authorization URL is returned for the user to complete setup.
See also: AWS API Documentation
Request Syntax
response = client.create_integration( integrationType='AWS_CONFIG_SLREC'|'SLACK'|'EXTERNAL_AGENT'|'AWS_INTEGRATION', name='string', credential={ 'oauthCodeCredential': { 'authCode': 'string' }, 'oauthClientCredential': { 'clientId': 'string', 'clientSecret': 'string', 'providerId': 'string' }, 'apiKeyCredential': { 'apiKeyValue': 'string' } }, integrationAttributes={ 'string': 'string' }, roleArn='string', tags={ 'string': 'string' }, clientToken='string' )
- Parameters:
integrationType (string) –
[REQUIRED]
The type of third-party provider to integrate with.
name (string) –
[REQUIRED]
The name for the new integration; unique within the account.
credential (dict) –
The credential used to authenticate with the third-party provider.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
oauthCodeCredential,oauthClientCredential,apiKeyCredential.oauthCodeCredential (dict) –
Credentials for an OAuth 2.0 authorization-code grant.
authCode (string) – [REQUIRED]
The OAuth 2.0 authorization code returned by the external system’s authorization endpoint.
oauthClientCredential (dict) –
Credentials for an OAuth 2.0 client-credentials grant.
clientId (string) – [REQUIRED]
The OAuth 2.0 client identifier registered with the external system.
clientSecret (string) – [REQUIRED]
The OAuth 2.0 client secret that pairs with the client identifier.
providerId (string) –
The identifier of the OAuth provider that issued the client credentials.
apiKeyCredential (dict) –
An API key credential.
apiKeyValue (string) – [REQUIRED]
The API key value used to authenticate with the external system.
integrationAttributes (dict) –
Provider-specific attributes to associate with the integration.
(string) –
(string) –
roleArn (string) – The Amazon Resource Name of the IAM role assumed to access the integration.
tags (dict) –
Tags to apply to the integration at creation time (Tagris tag-on-create).
(string) –
Tag key. Must be non-empty; AWS-standard maximum length. Constraining the key (rather than a bare String) rejects empty-key payloads at the edge with a 400 ValidationException instead of faulting downstream as a 500.
(string) –
Tag value. AWS-standard maximum length; may be empty.
clientToken (string) –
Idempotency token for safe retries. Retrying with the same token returns the original integration instead of creating a duplicate.
This field is autopopulated if not provided.
- Return type:
dict
- Returns:
Response Syntax
{ 'integration': { 'integrationId': 'string', 'integrationArn': 'string', 'integrationType': 'AWS_CONFIG_SLREC'|'SLACK'|'EXTERNAL_AGENT'|'AWS_INTEGRATION', 'name': 'string', 'status': 'ACTIVE'|'DELETED'|'PENDING'|'PENDING_OAUTH'|'ERROR'|'FAILED', 'authType': 'NONE'|'OAUTH2'|'API_KEY', 'credentialArn': 'string', 'roleArn': 'string', 'integrationAttributes': { 'string': 'string' }, 'authorizationUrl': 'string', 'errorMessage': 'string', 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1), 'scope': 'ACCOUNT'|'ORGANIZATION' } }
Response Structure
(dict) –
The response from creating an integration.
integration (dict) –
The details of the created integration. This is the same object returned by GetIntegration and UpdateIntegration.
integrationId (string) –
The unique identifier of the integration.
integrationArn (string) –
The Amazon Resource Name (ARN) of the integration.
integrationType (string) –
The type of external system that an integration connects to, such as a source of configuration data, a messaging destination, or a model provider.
name (string) –
The customer-provided name of the integration.
status (string) –
The current lifecycle state of an integration.
authType (string) –
The authentication method that an integration uses to connect to its external system.
credentialArn (string) –
The Amazon Resource Name (ARN) of the secret that stores the integration’s credentials.
roleArn (string) –
The Amazon Resource Name (ARN) of the IAM role that CloudWatch assumes to access the external system.
integrationAttributes (dict) –
Provider-specific key/value attributes that configure the integration.
(string) –
(string) –
authorizationUrl (string) –
The URL the customer visits to authorize the integration. Present while an OAuth authorization is pending.
errorMessage (string) –
A human-readable description of why the integration is in an ERROR or FAILED state. Present only when the integration has failed.
createdAt (datetime) –
The time at which the integration was created.
updatedAt (datetime) –
The time at which the integration was last updated.
scope (string) –
Whether this integration is account-scoped (ACCOUNT, customer-created) or organization-scoped (ORGANIZATION, created by an org-enablement rule). Absent on legacy records is treated as ACCOUNT.
Exceptions