Share via


Microsoft.AwsConnector cloudTrailTrails

Bicep resource definition

The cloudTrailTrails resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.AwsConnector/cloudTrailTrails resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.AwsConnector/cloudTrailTrails@2024-12-01' = {
  location: 'string'
  name: 'string'
  properties: {
    arn: 'string'
    awsAccountId: 'string'
    awsProperties: {
      advancedEventSelectors: [
        {
          fieldSelectors: [
            {
              endsWith: [
                'string'
              ]
              equals: [
                'string'
              ]
              field: 'string'
              notEndsWith: [
                'string'
              ]
              notEquals: [
                'string'
              ]
              notStartsWith: [
                'string'
              ]
              startsWith: [
                'string'
              ]
            }
          ]
          name: 'string'
        }
      ]
      arn: 'string'
      cloudWatchLogsLogGroupArn: 'string'
      cloudWatchLogsRoleArn: 'string'
      enableLogFileValidation: bool
      eventSelectors: [
        {
          dataResources: [
            {
              type: 'string'
              values: [
                'string'
              ]
            }
          ]
          excludeManagementEventSources: [
            'string'
          ]
          includeManagementEvents: bool
          readWriteType: 'string'
        }
      ]
      includeGlobalServiceEvents: bool
      insightSelectors: [
        {
          insightType: 'string'
        }
      ]
      isLogging: bool
      isMultiRegionTrail: bool
      isOrganizationTrail: bool
      kmsKeyId: 'string'
      s3BucketName: 'string'
      s3KeyPrefix: 'string'
      snsTopicArn: 'string'
      snsTopicName: 'string'
      tags: [
        {
          key: 'string'
          value: 'string'
        }
      ]
      trailName: 'string'
    }
    awsRegion: 'string'
    awsSourceSchema: 'string'
    awsTags: {
      {customized property}: 'string'
    }
    publicCloudConnectorsResourceId: 'string'
    publicCloudResourceName: 'string'
  }
  tags: {
    {customized property}: 'string'
  }
}

Property Values

Microsoft.AwsConnector/cloudTrailTrails

Name Description Value
location The geo-location where the resource lives string (required)
name The resource name string

Constraints:
Pattern = ^(?=.{0,259}[^\s.]$)(?!.*[<>%&\?/#]) (required)
properties The resource-specific properties for this resource. CloudTrailProperties
tags Resource tags Dictionary of tag names and values. See Tags in templates

AdvancedEventSelector

Name Description Value
fieldSelectors Contains all selector statements in an advanced event selector. AdvancedFieldSelector[]
name An optional, descriptive name for an advanced event selector, such as 'Log data events for only two S3 buckets'. string

AdvancedFieldSelector

Name Description Value
endsWith An operator that includes events that match the last few characters of the event record field specified as the value of Field. string[]
equals An operator that includes events that match the exact value of the event record field specified as the value of Field. This is the only valid operator that you can use with the readOnly, eventCategory, and resources.type fields. string[]
field A field in an event record on which to filter events to be logged. Supported fields include readOnly, eventCategory, eventSource (for management events), eventName, resources.type, and resources.ARN. string
notEndsWith An operator that excludes events that match the last few characters of the event record field specified as the value of Field. string[]
notEquals An operator that excludes events that match the exact value of the event record field specified as the value of Field. string[]
notStartsWith An operator that excludes events that match the first few characters of the event record field specified as the value of Field. string[]
startsWith An operator that includes events that match the first few characters of the event record field specified as the value of Field. string[]

AwsCloudTrailProperties

Name Description Value
advancedEventSelectors The advanced event selectors that were used to select events for the data store. AdvancedEventSelector[]
arn Property arn string
cloudWatchLogsLogGroupArn Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs will be delivered. Not required unless you specify CloudWatchLogsRoleArn. string
cloudWatchLogsRoleArn Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. string
enableLogFileValidation Specifies whether log file validation is enabled. The default is false. bool
eventSelectors Use event selectors to further specify the management and data event settings for your trail. By default, trails created without specific event selectors will be configured to log all read and write management events, and no data events. When an event occurs in your account, CloudTrail evaluates the event selector for all trails. For each trail, if the event matches any event selector, the trail processes and logs the event. If the event doesn't match any event selector, the trail doesn't log the event. You can configure up to five event selectors for a trail. EventSelector[]
includeGlobalServiceEvents Specifies whether the trail is publishing events from global services such as IAM to the log files. bool
insightSelectors Lets you enable Insights event logging by specifying the Insights selectors that you want to enable on an existing trail. InsightSelector[]
isLogging Whether the CloudTrail is currently logging AWS API calls. bool
isMultiRegionTrail Specifies whether the trail applies only to the current region or to all regions. The default is false. If the trail exists only in the current region and this value is set to true, shadow trails (replications of the trail) will be created in the other regions. If the trail exists in all regions and this value is set to false, the trail will remain in the region where it was created, and its shadow trails in other regions will be deleted. As a best practice, consider using trails that log events in all regions. bool
isOrganizationTrail Specifies whether the trail is created for all accounts in an organization in AWS Organizations, or only for the current AWS account. The default is false, and cannot be true unless the call is made on behalf of an AWS account that is the master account for an organization in AWS Organizations. bool
kmsKeyId Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. The value can be an alias name prefixed by 'alias/', a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier. string
s3BucketName Specifies the name of the Amazon S3 bucket designated for publishing log files. See Amazon S3 Bucket Naming Requirements. string
s3KeyPrefix Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files. The maximum length is 200 characters. string
snsTopicArn Property snsTopicArn string
snsTopicName Specifies the name of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters. string
tags Property tags Tag[]
trailName Property trailName string

CloudTrailProperties

Name Description Value
arn Amazon Resource Name (ARN) string
awsAccountId AWS Account ID string
awsProperties AWS Properties AwsCloudTrailProperties
awsRegion AWS Region string
awsSourceSchema AWS Source Schema string
awsTags AWS Tags CloudTrailPropertiesAwsTags
publicCloudConnectorsResourceId Public Cloud Connectors Resource ID string
publicCloudResourceName Public Cloud Resource Name string

CloudTrailPropertiesAwsTags

Name Description Value

DataResource

Name Description Value
type The resource type in which you want to log data events. You can specify AWS::S3::Object or AWS::Lambda::Function resources. string
values An array of Amazon Resource Name (ARN) strings or partial ARN strings for the specified objects. string[]

EventSelector

Name Description Value
dataResources Property dataResources DataResource[]
excludeManagementEventSources An optional list of service event sources from which you do not want management events to be logged on your trail. In this release, the list can be empty (disables the filter), or it can filter out AWS Key Management Service events by containing 'kms.amazonaws.com'. By default, ExcludeManagementEventSources is empty, and AWS KMS events are included in events that are logged to your trail. string[]
includeManagementEvents Specify if you want your event selector to include management events for your trail. bool
readWriteType Specify if you want your trail to log read-only events, write-only events, or all. For example, the EC2 GetConsoleOutput is a read-only API operation and RunInstances is a write-only API operation. 'All'
'ReadOnly'
'WriteOnly'

InsightSelector

Name Description Value
insightType The type of insight to log on a trail. string

Tag

Name Description Value
key The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. string
value The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. string

TrackedResourceTags

Name Description Value

ARM template resource definition

The cloudTrailTrails resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.AwsConnector/cloudTrailTrails resource, add the following JSON to your template.

{
  "type": "Microsoft.AwsConnector/cloudTrailTrails",
  "apiVersion": "2024-12-01",
  "name": "string",
  "location": "string",
  "properties": {
    "arn": "string",
    "awsAccountId": "string",
    "awsProperties": {
      "advancedEventSelectors": [
        {
          "fieldSelectors": [
            {
              "endsWith": [ "string" ],
              "equals": [ "string" ],
              "field": "string",
              "notEndsWith": [ "string" ],
              "notEquals": [ "string" ],
              "notStartsWith": [ "string" ],
              "startsWith": [ "string" ]
            }
          ],
          "name": "string"
        }
      ],
      "arn": "string",
      "cloudWatchLogsLogGroupArn": "string",
      "cloudWatchLogsRoleArn": "string",
      "enableLogFileValidation": "bool",
      "eventSelectors": [
        {
          "dataResources": [
            {
              "type": "string",
              "values": [ "string" ]
            }
          ],
          "excludeManagementEventSources": [ "string" ],
          "includeManagementEvents": "bool",
          "readWriteType": "string"
        }
      ],
      "includeGlobalServiceEvents": "bool",
      "insightSelectors": [
        {
          "insightType": "string"
        }
      ],
      "isLogging": "bool",
      "isMultiRegionTrail": "bool",
      "isOrganizationTrail": "bool",
      "kmsKeyId": "string",
      "s3BucketName": "string",
      "s3KeyPrefix": "string",
      "snsTopicArn": "string",
      "snsTopicName": "string",
      "tags": [
        {
          "key": "string",
          "value": "string"
        }
      ],
      "trailName": "string"
    },
    "awsRegion": "string",
    "awsSourceSchema": "string",
    "awsTags": {
      "{customized property}": "string"
    },
    "publicCloudConnectorsResourceId": "string",
    "publicCloudResourceName": "string"
  },
  "tags": {
    "{customized property}": "string"
  }
}

Property Values

Microsoft.AwsConnector/cloudTrailTrails

Name Description Value
apiVersion The api version '2024-12-01'
location The geo-location where the resource lives string (required)
name The resource name string

Constraints:
Pattern = ^(?=.{0,259}[^\s.]$)(?!.*[<>%&\?/#]) (required)
properties The resource-specific properties for this resource. CloudTrailProperties
tags Resource tags Dictionary of tag names and values. See Tags in templates
type The resource type 'Microsoft.AwsConnector/cloudTrailTrails'

AdvancedEventSelector

Name Description Value
fieldSelectors Contains all selector statements in an advanced event selector. AdvancedFieldSelector[]
name An optional, descriptive name for an advanced event selector, such as 'Log data events for only two S3 buckets'. string

AdvancedFieldSelector

Name Description Value
endsWith An operator that includes events that match the last few characters of the event record field specified as the value of Field. string[]
equals An operator that includes events that match the exact value of the event record field specified as the value of Field. This is the only valid operator that you can use with the readOnly, eventCategory, and resources.type fields. string[]
field A field in an event record on which to filter events to be logged. Supported fields include readOnly, eventCategory, eventSource (for management events), eventName, resources.type, and resources.ARN. string
notEndsWith An operator that excludes events that match the last few characters of the event record field specified as the value of Field. string[]
notEquals An operator that excludes events that match the exact value of the event record field specified as the value of Field. string[]
notStartsWith An operator that excludes events that match the first few characters of the event record field specified as the value of Field. string[]
startsWith An operator that includes events that match the first few characters of the event record field specified as the value of Field. string[]

AwsCloudTrailProperties

Name Description Value
advancedEventSelectors The advanced event selectors that were used to select events for the data store. AdvancedEventSelector[]
arn Property arn string
cloudWatchLogsLogGroupArn Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs will be delivered. Not required unless you specify CloudWatchLogsRoleArn. string
cloudWatchLogsRoleArn Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. string
enableLogFileValidation Specifies whether log file validation is enabled. The default is false. bool
eventSelectors Use event selectors to further specify the management and data event settings for your trail. By default, trails created without specific event selectors will be configured to log all read and write management events, and no data events. When an event occurs in your account, CloudTrail evaluates the event selector for all trails. For each trail, if the event matches any event selector, the trail processes and logs the event. If the event doesn't match any event selector, the trail doesn't log the event. You can configure up to five event selectors for a trail. EventSelector[]
includeGlobalServiceEvents Specifies whether the trail is publishing events from global services such as IAM to the log files. bool
insightSelectors Lets you enable Insights event logging by specifying the Insights selectors that you want to enable on an existing trail. InsightSelector[]
isLogging Whether the CloudTrail is currently logging AWS API calls. bool
isMultiRegionTrail Specifies whether the trail applies only to the current region or to all regions. The default is false. If the trail exists only in the current region and this value is set to true, shadow trails (replications of the trail) will be created in the other regions. If the trail exists in all regions and this value is set to false, the trail will remain in the region where it was created, and its shadow trails in other regions will be deleted. As a best practice, consider using trails that log events in all regions. bool
isOrganizationTrail Specifies whether the trail is created for all accounts in an organization in AWS Organizations, or only for the current AWS account. The default is false, and cannot be true unless the call is made on behalf of an AWS account that is the master account for an organization in AWS Organizations. bool
kmsKeyId Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. The value can be an alias name prefixed by 'alias/', a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier. string
s3BucketName Specifies the name of the Amazon S3 bucket designated for publishing log files. See Amazon S3 Bucket Naming Requirements. string
s3KeyPrefix Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files. The maximum length is 200 characters. string
snsTopicArn Property snsTopicArn string
snsTopicName Specifies the name of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters. string
tags Property tags Tag[]
trailName Property trailName string

CloudTrailProperties

Name Description Value
arn Amazon Resource Name (ARN) string
awsAccountId AWS Account ID string
awsProperties AWS Properties AwsCloudTrailProperties
awsRegion AWS Region string
awsSourceSchema AWS Source Schema string
awsTags AWS Tags CloudTrailPropertiesAwsTags
publicCloudConnectorsResourceId Public Cloud Connectors Resource ID string
publicCloudResourceName Public Cloud Resource Name string

CloudTrailPropertiesAwsTags

Name Description Value

DataResource

Name Description Value
type The resource type in which you want to log data events. You can specify AWS::S3::Object or AWS::Lambda::Function resources. string
values An array of Amazon Resource Name (ARN) strings or partial ARN strings for the specified objects. string[]

EventSelector

Name Description Value
dataResources Property dataResources DataResource[]
excludeManagementEventSources An optional list of service event sources from which you do not want management events to be logged on your trail. In this release, the list can be empty (disables the filter), or it can filter out AWS Key Management Service events by containing 'kms.amazonaws.com'. By default, ExcludeManagementEventSources is empty, and AWS KMS events are included in events that are logged to your trail. string[]
includeManagementEvents Specify if you want your event selector to include management events for your trail. bool
readWriteType Specify if you want your trail to log read-only events, write-only events, or all. For example, the EC2 GetConsoleOutput is a read-only API operation and RunInstances is a write-only API operation. 'All'
'ReadOnly'
'WriteOnly'

InsightSelector

Name Description Value
insightType The type of insight to log on a trail. string

Tag

Name Description Value
key The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. string
value The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. string

TrackedResourceTags

Name Description Value

Usage Examples

Terraform (AzAPI provider) resource definition

The cloudTrailTrails resource type can be deployed with operations that target:

  • Resource groups

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.AwsConnector/cloudTrailTrails resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.AwsConnector/cloudTrailTrails@2024-12-01"
  name = "string"
  parent_id = "string"
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = {
    properties = {
      arn = "string"
      awsAccountId = "string"
      awsProperties = {
        advancedEventSelectors = [
          {
            fieldSelectors = [
              {
                endsWith = [
                  "string"
                ]
                equals = [
                  "string"
                ]
                field = "string"
                notEndsWith = [
                  "string"
                ]
                notEquals = [
                  "string"
                ]
                notStartsWith = [
                  "string"
                ]
                startsWith = [
                  "string"
                ]
              }
            ]
            name = "string"
          }
        ]
        arn = "string"
        cloudWatchLogsLogGroupArn = "string"
        cloudWatchLogsRoleArn = "string"
        enableLogFileValidation = bool
        eventSelectors = [
          {
            dataResources = [
              {
                type = "string"
                values = [
                  "string"
                ]
              }
            ]
            excludeManagementEventSources = [
              "string"
            ]
            includeManagementEvents = bool
            readWriteType = "string"
          }
        ]
        includeGlobalServiceEvents = bool
        insightSelectors = [
          {
            insightType = "string"
          }
        ]
        isLogging = bool
        isMultiRegionTrail = bool
        isOrganizationTrail = bool
        kmsKeyId = "string"
        s3BucketName = "string"
        s3KeyPrefix = "string"
        snsTopicArn = "string"
        snsTopicName = "string"
        tags = [
          {
            key = "string"
            value = "string"
          }
        ]
        trailName = "string"
      }
      awsRegion = "string"
      awsSourceSchema = "string"
      awsTags = {
        {customized property} = "string"
      }
      publicCloudConnectorsResourceId = "string"
      publicCloudResourceName = "string"
    }
  }
}

Property Values

Microsoft.AwsConnector/cloudTrailTrails

Name Description Value
location The geo-location where the resource lives string (required)
name The resource name string

Constraints:
Pattern = ^(?=.{0,259}[^\s.]$)(?!.*[<>%&\?/#]) (required)
properties The resource-specific properties for this resource. CloudTrailProperties
tags Resource tags Dictionary of tag names and values.
type The resource type "Microsoft.AwsConnector/cloudTrailTrails@2024-12-01"

AdvancedEventSelector

Name Description Value
fieldSelectors Contains all selector statements in an advanced event selector. AdvancedFieldSelector[]
name An optional, descriptive name for an advanced event selector, such as 'Log data events for only two S3 buckets'. string

AdvancedFieldSelector

Name Description Value
endsWith An operator that includes events that match the last few characters of the event record field specified as the value of Field. string[]
equals An operator that includes events that match the exact value of the event record field specified as the value of Field. This is the only valid operator that you can use with the readOnly, eventCategory, and resources.type fields. string[]
field A field in an event record on which to filter events to be logged. Supported fields include readOnly, eventCategory, eventSource (for management events), eventName, resources.type, and resources.ARN. string
notEndsWith An operator that excludes events that match the last few characters of the event record field specified as the value of Field. string[]
notEquals An operator that excludes events that match the exact value of the event record field specified as the value of Field. string[]
notStartsWith An operator that excludes events that match the first few characters of the event record field specified as the value of Field. string[]
startsWith An operator that includes events that match the first few characters of the event record field specified as the value of Field. string[]

AwsCloudTrailProperties

Name Description Value
advancedEventSelectors The advanced event selectors that were used to select events for the data store. AdvancedEventSelector[]
arn Property arn string
cloudWatchLogsLogGroupArn Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs will be delivered. Not required unless you specify CloudWatchLogsRoleArn. string
cloudWatchLogsRoleArn Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. string
enableLogFileValidation Specifies whether log file validation is enabled. The default is false. bool
eventSelectors Use event selectors to further specify the management and data event settings for your trail. By default, trails created without specific event selectors will be configured to log all read and write management events, and no data events. When an event occurs in your account, CloudTrail evaluates the event selector for all trails. For each trail, if the event matches any event selector, the trail processes and logs the event. If the event doesn't match any event selector, the trail doesn't log the event. You can configure up to five event selectors for a trail. EventSelector[]
includeGlobalServiceEvents Specifies whether the trail is publishing events from global services such as IAM to the log files. bool
insightSelectors Lets you enable Insights event logging by specifying the Insights selectors that you want to enable on an existing trail. InsightSelector[]
isLogging Whether the CloudTrail is currently logging AWS API calls. bool
isMultiRegionTrail Specifies whether the trail applies only to the current region or to all regions. The default is false. If the trail exists only in the current region and this value is set to true, shadow trails (replications of the trail) will be created in the other regions. If the trail exists in all regions and this value is set to false, the trail will remain in the region where it was created, and its shadow trails in other regions will be deleted. As a best practice, consider using trails that log events in all regions. bool
isOrganizationTrail Specifies whether the trail is created for all accounts in an organization in AWS Organizations, or only for the current AWS account. The default is false, and cannot be true unless the call is made on behalf of an AWS account that is the master account for an organization in AWS Organizations. bool
kmsKeyId Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. The value can be an alias name prefixed by 'alias/', a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier. string
s3BucketName Specifies the name of the Amazon S3 bucket designated for publishing log files. See Amazon S3 Bucket Naming Requirements. string
s3KeyPrefix Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files. The maximum length is 200 characters. string
snsTopicArn Property snsTopicArn string
snsTopicName Specifies the name of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters. string
tags Property tags Tag[]
trailName Property trailName string

CloudTrailProperties

Name Description Value
arn Amazon Resource Name (ARN) string
awsAccountId AWS Account ID string
awsProperties AWS Properties AwsCloudTrailProperties
awsRegion AWS Region string
awsSourceSchema AWS Source Schema string
awsTags AWS Tags CloudTrailPropertiesAwsTags
publicCloudConnectorsResourceId Public Cloud Connectors Resource ID string
publicCloudResourceName Public Cloud Resource Name string

CloudTrailPropertiesAwsTags

Name Description Value

DataResource

Name Description Value
type The resource type in which you want to log data events. You can specify AWS::S3::Object or AWS::Lambda::Function resources. string
values An array of Amazon Resource Name (ARN) strings or partial ARN strings for the specified objects. string[]

EventSelector

Name Description Value
dataResources Property dataResources DataResource[]
excludeManagementEventSources An optional list of service event sources from which you do not want management events to be logged on your trail. In this release, the list can be empty (disables the filter), or it can filter out AWS Key Management Service events by containing 'kms.amazonaws.com'. By default, ExcludeManagementEventSources is empty, and AWS KMS events are included in events that are logged to your trail. string[]
includeManagementEvents Specify if you want your event selector to include management events for your trail. bool
readWriteType Specify if you want your trail to log read-only events, write-only events, or all. For example, the EC2 GetConsoleOutput is a read-only API operation and RunInstances is a write-only API operation. 'All'
'ReadOnly'
'WriteOnly'

InsightSelector

Name Description Value
insightType The type of insight to log on a trail. string

Tag

Name Description Value
key The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. string
value The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. string

TrackedResourceTags

Name Description Value