// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS GuardDuty */ export interface GuarddutyDetectorConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/guardduty_detector.html#enable GuarddutyDetector#enable} */ readonly enable?: boolean | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/guardduty_detector.html#finding_publishing_frequency GuarddutyDetector#finding_publishing_frequency} */ readonly findingPublishingFrequency?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/guardduty_detector.html#tags GuarddutyDetector#tags} */ readonly tags?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/guardduty_detector.html#tags_all GuarddutyDetector#tags_all} */ readonly tagsAll?: { [key: string]: string } | cdktf.IResolvable; /** * datasources block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/guardduty_detector.html#datasources GuarddutyDetector#datasources} */ readonly datasources?: GuarddutyDetectorDatasources; } export interface GuarddutyDetectorDatasourcesS3Logs { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/guardduty_detector.html#enable GuarddutyDetector#enable} */ readonly enable: boolean | cdktf.IResolvable; } export function guarddutyDetectorDatasourcesS3LogsToTerraform(struct?: GuarddutyDetectorDatasourcesS3LogsOutputReference | GuarddutyDetectorDatasourcesS3Logs): any { if (!cdktf.canInspect(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } return { enable: cdktf.booleanToTerraform(struct!.enable), } } export class GuarddutyDetectorDatasourcesS3LogsOutputReference extends cdktf.ComplexObject { private isEmptyObject = false; /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param isSingleItem True if this is a block, false if it's a list */ public constructor(terraformResource: cdktf.ITerraformResource, terraformAttribute: string, isSingleItem: boolean) { super(terraformResource, terraformAttribute, isSingleItem); } public get internalValue(): GuarddutyDetectorDatasourcesS3Logs | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._enable !== undefined) { hasAnyValues = true; internalValueResult.enable = this._enable; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: GuarddutyDetectorDatasourcesS3Logs | undefined) { if (value === undefined) { this.isEmptyObject = false; this._enable = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._enable = value.enable; } } // enable - computed: false, optional: false, required: true private _enable?: boolean | cdktf.IResolvable; public get enable() { return this.getBooleanAttribute('enable') as any; } public set enable(value: boolean | cdktf.IResolvable) { this._enable = value; } // Temporarily expose input value. Use with caution. public get enableInput() { return this._enable; } } export interface GuarddutyDetectorDatasources { /** * s3_logs block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/guardduty_detector.html#s3_logs GuarddutyDetector#s3_logs} */ readonly s3Logs?: GuarddutyDetectorDatasourcesS3Logs; } export function guarddutyDetectorDatasourcesToTerraform(struct?: GuarddutyDetectorDatasourcesOutputReference | GuarddutyDetectorDatasources): any { if (!cdktf.canInspect(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } return { s3_logs: guarddutyDetectorDatasourcesS3LogsToTerraform(struct!.s3Logs), } } export class GuarddutyDetectorDatasourcesOutputReference extends cdktf.ComplexObject { private isEmptyObject = false; /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param isSingleItem True if this is a block, false if it's a list */ public constructor(terraformResource: cdktf.ITerraformResource, terraformAttribute: string, isSingleItem: boolean) { super(terraformResource, terraformAttribute, isSingleItem); } public get internalValue(): GuarddutyDetectorDatasources | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._s3Logs?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.s3Logs = this._s3Logs?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: GuarddutyDetectorDatasources | undefined) { if (value === undefined) { this.isEmptyObject = false; this._s3Logs.internalValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._s3Logs.internalValue = value.s3Logs; } } // s3_logs - computed: false, optional: true, required: false private _s3Logs = new GuarddutyDetectorDatasourcesS3LogsOutputReference(this as any, "s3_logs", true); public get s3Logs() { return this._s3Logs; } public putS3Logs(value: GuarddutyDetectorDatasourcesS3Logs) { this._s3Logs.internalValue = value; } public resetS3Logs() { this._s3Logs.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get s3LogsInput() { return this._s3Logs.internalValue; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/guardduty_detector.html aws_guardduty_detector} */ export class GuarddutyDetector extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_guardduty_detector"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/guardduty_detector.html aws_guardduty_detector} Resource * * @param scope The scope in which to define this construct * @param id The scoped construct ID. Must be unique amongst siblings in the same scope * @param options GuarddutyDetectorConfig = {} */ public constructor(scope: Construct, id: string, config: GuarddutyDetectorConfig = {}) { super(scope, id, { terraformResourceType: 'aws_guardduty_detector', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._enable = config.enable; this._findingPublishingFrequency = config.findingPublishingFrequency; this._tags = config.tags; this._tagsAll = config.tagsAll; this._datasources.internalValue = config.datasources; } // ========== // ATTRIBUTES // ========== // account_id - computed: true, optional: false, required: false public get accountId() { return this.getStringAttribute('account_id'); } // arn - computed: true, optional: false, required: false public get arn() { return this.getStringAttribute('arn'); } // enable - computed: false, optional: true, required: false private _enable?: boolean | cdktf.IResolvable; public get enable() { return this.getBooleanAttribute('enable') as any; } public set enable(value: boolean | cdktf.IResolvable) { this._enable = value; } public resetEnable() { this._enable = undefined; } // Temporarily expose input value. Use with caution. public get enableInput() { return this._enable; } // finding_publishing_frequency - computed: true, optional: true, required: false private _findingPublishingFrequency?: string; public get findingPublishingFrequency() { return this.getStringAttribute('finding_publishing_frequency'); } public set findingPublishingFrequency(value: string) { this._findingPublishingFrequency = value; } public resetFindingPublishingFrequency() { this._findingPublishingFrequency = undefined; } // Temporarily expose input value. Use with caution. public get findingPublishingFrequencyInput() { return this._findingPublishingFrequency; } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // tags - computed: false, optional: true, required: false private _tags?: { [key: string]: string } | cdktf.IResolvable; public get tags() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('tags') as any; } public set tags(value: { [key: string]: string } | cdktf.IResolvable) { this._tags = value; } public resetTags() { this._tags = undefined; } // Temporarily expose input value. Use with caution. public get tagsInput() { return this._tags; } // tags_all - computed: true, optional: true, required: false private _tagsAll?: { [key: string]: string } | cdktf.IResolvable; public get tagsAll() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('tags_all') as any; } public set tagsAll(value: { [key: string]: string } | cdktf.IResolvable) { this._tagsAll = value; } public resetTagsAll() { this._tagsAll = undefined; } // Temporarily expose input value. Use with caution. public get tagsAllInput() { return this._tagsAll; } // datasources - computed: false, optional: true, required: false private _datasources = new GuarddutyDetectorDatasourcesOutputReference(this as any, "datasources", true); public get datasources() { return this._datasources; } public putDatasources(value: GuarddutyDetectorDatasources) { this._datasources.internalValue = value; } public resetDatasources() { this._datasources.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get datasourcesInput() { return this._datasources.internalValue; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { enable: cdktf.booleanToTerraform(this._enable), finding_publishing_frequency: cdktf.stringToTerraform(this._findingPublishingFrequency), tags: cdktf.hashMapper(cdktf.anyToTerraform)(this._tags), tags_all: cdktf.hashMapper(cdktf.anyToTerraform)(this._tagsAll), datasources: guarddutyDetectorDatasourcesToTerraform(this._datasources.internalValue), }; } }