import * as pulumi from "@pulumi/pulumi"; /** * Manages a CloudWatch Observability Admin Dataset Integration. A dataset integration enables CloudWatch to forward the account's telemetry to a dataset using an IAM role that you provide. * * > **NOTE:** Only one dataset integration can exist per account and Region. Creating a second one fails with a `ConflictException`. To manage an existing dataset integration, import it. * * > **NOTE:** A successful apply does not prove that forwarding works. If the execution role's trust policy names the wrong account in `aws:SourceAccount` or `aws:SourceArn`, or the role lacks the permissions below, the integration is still created but nothing is forwarded. * * Before you create the integration: * * * The caller needs `iam:PassRole` on the execution role to create or update the integration. * * The execution role must be in the same account as the integration and must trust `logs.amazonaws.com`. Both trust policy conditions must name that account, as in the example below. * * The role's `logs:IntegrateWithDataset` permissions decide which log groups are forwarded. `log-group:*` forwards all log groups in the account. Log groups in the Delivery log class are never forwarded. * * If the destination dataset is encrypted with a customer managed AWS KMS key, the key policy must allow the execution role `kms:Encrypt`, `kms:Decrypt`, and `kms:GenerateDataKey`. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const current = aws.getCallerIdentity({}); * const currentGetPartition = aws.getPartition({}); * const currentGetRegion = aws.getRegion({}); * const example = new aws.iam.Role("example", { * name: "example-dataset-integration", * assumeRolePolicy: JSON.stringify({ * Version: "2012-10-17", * Statement: [{ * Action: "sts:AssumeRole", * Effect: "Allow", * Principal: { * Service: "logs.amazonaws.com", * }, * Condition: { * StringEquals: { * "aws:SourceAccount": current.then(current => current.accountId), * }, * ArnLike: { * "aws:SourceArn": Promise.all([currentGetPartition, currentGetRegion, current]).then(([currentGetPartition, currentGetRegion, current]) => `arn:${currentGetPartition.partition}:observabilityadmin:${currentGetRegion.region}:${current.accountId}:dataset-integration/default`), * }, * }, * }], * }), * }); * const exampleRolePolicy = new aws.iam.RolePolicy("example", { * role: example.name, * policy: JSON.stringify({ * Version: "2012-10-17", * Statement: [ * { * Effect: "Allow", * Action: "logs:IntegrateWithDataset", * Resource: Promise.all([currentGetPartition, currentGetRegion, current]).then(([currentGetPartition, currentGetRegion, current]) => `arn:${currentGetPartition.partition}:logs:${currentGetRegion.region}:${current.accountId}:log-group:*`), * }, * { * Effect: "Allow", * Action: "cloudwatch:PutRecords", * Resource: "*", * }, * ], * }), * }); * const exampleDatasetIntegration = new aws.observabilityadmin.DatasetIntegration("example", {roleArn: example.arn}, { * dependsOn: [exampleRolePolicy], * }); * ``` * * ## Import * * ### Identity Schema * * #### Required * * - `arn` (String) ARN of the dataset integration. * * Using `pulumi import`, import CloudWatch Observability Admin Dataset Integrations using the `arn`. For example: * * ```sh * $ pulumi import aws:observabilityadmin/datasetIntegration:DatasetIntegration example arn:aws:observabilityadmin:us-east-1:123456789012:dataset-integration/default * ``` */ export declare class DatasetIntegration extends pulumi.CustomResource { /** * Get an existing DatasetIntegration resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: DatasetIntegrationState, opts?: pulumi.CustomResourceOptions): DatasetIntegration; /** * Check whether an existing DatasetIntegration resource with the given ID exists. * * @param id The _unique_ provider ID of the resource to check. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static exists(id: pulumi.Input, state?: DatasetIntegrationState, opts?: pulumi.CustomResourceOptions): pulumi.Output; /** * Returns true if the given object is an instance of DatasetIntegration. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is DatasetIntegration; /** * ARN of the dataset integration. */ readonly arn: pulumi.Output; /** * Timestamp when the dataset integration was created, in [RFC3339 format](https://datatracker.ietf.org/doc/html/rfc3339#section-5.8). */ readonly createdAt: pulumi.Output; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output; /** * ARN of the IAM role that grants CloudWatch permission to access the resources needed for the dataset integration. * * The following arguments are optional: */ readonly roleArn: pulumi.Output; /** * Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. */ readonly tagsAll: pulumi.Output<{ [key: string]: string; }>; /** * Timestamp when the dataset integration was last updated, in [RFC3339 format](https://datatracker.ietf.org/doc/html/rfc3339#section-5.8). */ readonly updatedAt: pulumi.Output; /** * Create a DatasetIntegration resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: DatasetIntegrationArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering DatasetIntegration resources. */ export interface DatasetIntegrationState { /** * ARN of the dataset integration. */ arn?: pulumi.Input; /** * Timestamp when the dataset integration was created, in [RFC3339 format](https://datatracker.ietf.org/doc/html/rfc3339#section-5.8). */ createdAt?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * ARN of the IAM role that grants CloudWatch permission to access the resources needed for the dataset integration. * * The following arguments are optional: */ roleArn?: pulumi.Input; /** * Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. */ tagsAll?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * Timestamp when the dataset integration was last updated, in [RFC3339 format](https://datatracker.ietf.org/doc/html/rfc3339#section-5.8). */ updatedAt?: pulumi.Input; } /** * The set of arguments for constructing a DatasetIntegration resource. */ export interface DatasetIntegrationArgs { /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * ARN of the IAM role that grants CloudWatch permission to access the resources needed for the dataset integration. * * The following arguments are optional: */ roleArn: pulumi.Input; /** * Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; } //# sourceMappingURL=datasetIntegration.d.ts.map