code_security_integrations
Creates, updates, deletes, gets or lists a code_security_integrations resource.
Overview
| Name | code_security_integrations |
| Type | Resource |
| Id | aws.inspector2.code_security_integrations |
Fields
The following fields are returned by SELECT queries:
- get_code_security_integration
- list_code_security_integrations
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the code security integration. (pattern: <code>[a-zA-Z0-9-_$:.]*</code>) |
authorization_url | string | The URL used to authorize the integration with the repository provider. This is only returned if reauthorization is required to fix a connection issue. Otherwise, it is null. |
created_on | string (date-time) | The timestamp when the code security integration was created. |
integration_arn | string | arn:aws:inspector2:::codesecurity-integration/ (pattern: <code>arn:(aws[a-zA-Z-]*)?:inspector2:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:codesecurity-integration/[a-f0-9-]{36}</code>) |
last_update_on | string (date-time) | The timestamp when the code security integration was last updated. |
status | string | The current status of the code security integration. (PENDING, IN_PROGRESS, ACTIVE, INACTIVE, DISABLING) |
status_reason | string | The reason for the current status of the code security integration. |
tags | object | The tags associated with the code security integration. |
type_ | string | The type of repository provider for the integration. (GITLAB_SELF_MANAGED, GITHUB) |
| Name | Datatype | Description |
|---|---|---|
integrations | array | A list of code security integration summaries. |
next_token | string | A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request. For subsequent calls, use the NextToken value returned from the previous request to continue listing results after the first page. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_code_security_integration | select | region | Retrieves information about a code security integration. | |
list_code_security_integrations | select | region | nextToken, maxResults | Lists all code security integrations in your account. |
create_code_security_integration | insert | region, name, type | Creates a code security integration with a source code repository provider. After calling the CreateCodeSecurityIntegration operation, you complete authentication and authorization with your provider. Next you call the UpdateCodeSecurityIntegration operation to provide the details to complete the integration setup | |
update_code_security_integration | update | region, integrationArn, details | Updates an existing code security integration. After calling the CreateCodeSecurityIntegration operation, you complete authentication and authorization with your provider. Next you call the UpdateCodeSecurityIntegration operation to provide the details to complete the integration setup | |
delete_code_security_integration | delete | region | Deletes a code security integration. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
maxResults | integer | The maximum number of results to return in a single call. |
nextToken | string | A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request. For subsequent calls, use the NextToken value returned from the previous request to continue listing results after the first page. |
SELECT examples
- get_code_security_integration
- list_code_security_integrations
Retrieves information about a code security integration.
SELECT
name,
authorization_url,
created_on,
integration_arn,
last_update_on,
status,
status_reason,
tags,
type_
FROM aws.inspector2.code_security_integrations
WHERE region = '{{ region }}' -- required
;
Lists all code security integrations in your account.
SELECT
integrations,
next_token
FROM aws.inspector2.code_security_integrations
WHERE region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;
INSERT examples
- create_code_security_integration
- Manifest
Creates a code security integration with a source code repository provider. After calling the CreateCodeSecurityIntegration operation, you complete authentication and authorization with your provider. Next you call the UpdateCodeSecurityIntegration operation to provide the details to complete the integration setup
INSERT INTO aws.inspector2.code_security_integrations (
name,
type,
details,
tags,
region
)
SELECT
'{{ name }}' /* required */,
'{{ type }}' /* required */,
'{{ details }}',
'{{ tags }}',
'{{ region }}'
RETURNING
authorization_url,
integration_arn,
status
;
# Description fields are for documentation purposes
- name: code_security_integrations
props:
- name: region
value: "{{ region }}"
description: Required parameter for the code_security_integrations resource.
- name: name
value: "{{ name }}"
- name: type
value: "{{ type }}"
valid_values: ['GITLAB_SELF_MANAGED', 'GITHUB']
- name: details
description: |
Contains details required to create a code security integration with a specific repository provider.
value:
gitlabSelfManaged:
instanceUrl: "{{ instanceUrl }}"
accessToken: "{{ accessToken }}"
- name: tags
value: "{{ tags }}"
UPDATE examples
- update_code_security_integration
Updates an existing code security integration. After calling the CreateCodeSecurityIntegration operation, you complete authentication and authorization with your provider. Next you call the UpdateCodeSecurityIntegration operation to provide the details to complete the integration setup
UPDATE aws.inspector2.code_security_integrations
SET
integrationArn = '{{ integrationArn }}',
details = '{{ details }}'
WHERE
region = '{{ region }}' --required
AND integrationArn = '{{ integrationArn }}' --required
AND details = '{{ details }}' --required
RETURNING
integration_arn,
status;
DELETE examples
- delete_code_security_integration
Deletes a code security integration.
DELETE FROM aws.inspector2.code_security_integrations
WHERE region = '{{ region }}' --required
;