Integrations

Use these GraphQL operations to configure IAM Delegated Access programmatically.

To learn how to set up IAM Delegated Access for your cloud storage solution, see our IAM Delegated Access docs.

Get integration ID

Use this query to get a list of all IAM integrations.

query GetIntegrations {
  iamIntegrations {
    id
    name
  }
}

Create integration

Use the createAwsIamIntegration mutation to create a Delegated Access integration between your S3 bucket and Labelbox.

Specifying the roleArn when you are creating the integration is optional.

The id returned from this createAwsIntegration mutation is the Labelbox External ID. The Labelbox AWS account ID is 340636424752.

FieldTypeDescription
nameStringThe name of the new IAM integration.
roleArnStringThe ARN (Amazon Resource Name) for the role created for Labelbox in your AWS account. If you do not have a role yet, you can leave out roleArn.
mutation CreateIntegration {
    createAwsIamIntegration (data: { 
      name: "AWS IAM Integration" 
      roleArn: "arn:aws:iam::<AWS_ACCOUNT_ID>:role/<ROLE_NAME>"
    }) {
	id
    }
}

Validate integration

Use the validateIamIntegration mutation to ensure that the integration you set up via IAM was configured properly.

FieldTypeDescription
validBooleanIndicates whether the IAM integration is valid.
nameIamIntegrationValidationCheckNameValues are AWSAssumeRole and AWSExternalID. See Troubleshooting for more information.
successBooleanIndicates whether the check was successful.
mutation CheckIntegration {
  validateIamIntegration (where: {id: "<INTEGRATION_ID>"}) {
    valid
    checks { 
      name
      success
    }
  }
}

Update integration

Use the updateAwsIamIntegration mutation to update the role ARN associated with the integration. Use the where argument to specify which integration you want to update and the data argument to specify what you want to update (i.e., roleArn or name).

FieldTypeDescription
nameStringName of the IAM integration you want to update.
roleArnStringARN of the IAM integration you want to update.
idIDID for the integration you created via the createAwsIamIntegration mutation.
mutation UpdateIntegration {
    updateAwsIamIntegration (
        data: { 
            roleArn: "arn:aws:iam::<ACCOUNT_ID>:role/<ROLE_NAME>"
            name: "<NEW_INTEGRATION_NAME>"
        },
	where: { 
            id: "<INTEGRATION_ID>" 
        }) {
            id
        }
}

Attach integration to a dataset

Use the setSignerForDataset mutation to attach an IAM integration to your dataset. Use the where argument to specify the dataset and the data argument to specify what to change.

FieldTypeDescription
signerIdIDThe ID of an IAM integration to use as a signer for the dataset.
idIDDataset ID.
mutation SetSignerForDataset {
    setSignerForDataset (
	data: { signerId: "<INTEGRATION_ID>" },
	where: { id: "<DATASET_ID>" }) {
	    id
	    signer {
		id
	}
    }
}

Validate dataset

When you create your dataset via the GraphQL API, you'll need to run a dataset validation yourself. Use the validateDataset mutation to do this.

This returns a payload with the status of the various checks that you can use for troubleshooting.

FieldTypeDescription
validBooleanIndicates whether the dataset was connected to the IAM integration successfully.
nameDatasetValidationCheckNameValues are CORSPreflight and FetchAsset. For more information, see the Troubleshooting section.
successBooleanIndicates whether the dataset validation check was successful.
mutation ValidateDataset {
  validateDataset (where: {id: "<DATASET_ID>"}){
    valid
    checks {
      name
      success
    }
  }
}