Skip to main content

invitations

Creates, updates, deletes, gets or lists an invitations resource.

Overview

Nameinvitations
TypeResource
Idaws.guardduty.invitations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
account_idstringThe ID of the account that the invitation was sent from.
invitation_idstringThe ID of the invitation. This value is used to validate the inviter account to the member account.
invited_atstringThe timestamp when the invitation was sent.
relationship_statusstringThe status of the relationship between the inviter and invitee accounts.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_invitationsselectregionmaxResults, nextTokenLists all GuardDuty membership invitations that were sent to the current Amazon Web Services account.
delete_invitationsdeleteregionDeletes invitations sent to the current member account by Amazon Web Services accounts specified by their account IDs.
accept_administrator_invitationexecdetector_id, region, AdministratorId, InvitationIdAccepts the invitation to be a member account and get monitored by a GuardDuty administrator account that sent the invitation.
accept_invitationexecdetector_id, region, MasterId, InvitationIdAccepts the invitation to be monitored by a GuardDuty administrator account.
decline_invitationsexecregion, AccountIdsDeclines invitations sent to the current member account by Amazon Web Services accounts specified by their account IDs.

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.

NameDatatypeDescription
detector_idstringThe unique ID of the detector of the GuardDuty member account. To find the detectorId in the current Region, see the Settings page in the GuardDuty console, or run the ListDetectors API.
regionstringAWS region (default: us-east-1)
maxResultsintegerYou can use this parameter to indicate the maximum number of items that you want in the response. The default value is 50. The maximum value is 50.
nextTokenstringYou can use this parameter when paginating results. Set the value of this parameter to null on your first call to the list action. For subsequent calls to the action, fill nextToken in the request with the value of NextToken from the previous response to continue listing data.

SELECT examples

Lists all GuardDuty membership invitations that were sent to the current Amazon Web Services account.

SELECT
account_id,
invitation_id,
invited_at,
relationship_status
FROM aws.guardduty.invitations
WHERE region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;

DELETE examples

Deletes invitations sent to the current member account by Amazon Web Services accounts specified by their account IDs.

DELETE FROM aws.guardduty.invitations
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Accepts the invitation to be a member account and get monitored by a GuardDuty administrator account that sent the invitation.

EXEC aws.guardduty.invitations.accept_administrator_invitation
@detector_id='{{ detector_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"AdministratorId": "{{ AdministratorId }}",
"InvitationId": "{{ InvitationId }}"
}'
;