
com.pulumi.aws.guardduty.kotlin.DetectorFeature.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.guardduty.kotlin
import com.pulumi.aws.guardduty.kotlin.outputs.DetectorFeatureAdditionalConfiguration
import com.pulumi.aws.guardduty.kotlin.outputs.DetectorFeatureAdditionalConfiguration.Companion.toKotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
/**
* Builder for [DetectorFeature].
*/
@PulumiTagMarker
public class DetectorFeatureResourceBuilder internal constructor() {
public var name: String? = null
public var args: DetectorFeatureArgs = DetectorFeatureArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend DetectorFeatureArgsBuilder.() -> Unit) {
val builder = DetectorFeatureArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): DetectorFeature {
val builtJavaResource = com.pulumi.aws.guardduty.DetectorFeature(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return DetectorFeature(builtJavaResource)
}
}
/**
* Provides a resource to manage a single Amazon GuardDuty [detector feature](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty-features-activation-model.html#guardduty-features).
* > **NOTE:** Deleting this resource does not disable the detector feature, the resource in simply removed from state instead.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const example = new aws.guardduty.Detector("example", {enable: true});
* const eksRuntimeMonitoring = new aws.guardduty.DetectorFeature("eks_runtime_monitoring", {
* detectorId: example.id,
* name: "EKS_RUNTIME_MONITORING",
* status: "ENABLED",
* additionalConfigurations: [{
* name: "EKS_ADDON_MANAGEMENT",
* status: "ENABLED",
* }],
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.guardduty.Detector("example", enable=True)
* eks_runtime_monitoring = aws.guardduty.DetectorFeature("eks_runtime_monitoring",
* detector_id=example.id,
* name="EKS_RUNTIME_MONITORING",
* status="ENABLED",
* additional_configurations=[{
* "name": "EKS_ADDON_MANAGEMENT",
* "status": "ENABLED",
* }])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.GuardDuty.Detector("example", new()
* {
* Enable = true,
* });
* var eksRuntimeMonitoring = new Aws.GuardDuty.DetectorFeature("eks_runtime_monitoring", new()
* {
* DetectorId = example.Id,
* Name = "EKS_RUNTIME_MONITORING",
* Status = "ENABLED",
* AdditionalConfigurations = new[]
* {
* new Aws.GuardDuty.Inputs.DetectorFeatureAdditionalConfigurationArgs
* {
* Name = "EKS_ADDON_MANAGEMENT",
* Status = "ENABLED",
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/guardduty"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := guardduty.NewDetector(ctx, "example", &guardduty.DetectorArgs{
* Enable: pulumi.Bool(true),
* })
* if err != nil {
* return err
* }
* _, err = guardduty.NewDetectorFeature(ctx, "eks_runtime_monitoring", &guardduty.DetectorFeatureArgs{
* DetectorId: example.ID(),
* Name: pulumi.String("EKS_RUNTIME_MONITORING"),
* Status: pulumi.String("ENABLED"),
* AdditionalConfigurations: guardduty.DetectorFeatureAdditionalConfigurationArray{
* &guardduty.DetectorFeatureAdditionalConfigurationArgs{
* Name: pulumi.String("EKS_ADDON_MANAGEMENT"),
* Status: pulumi.String("ENABLED"),
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.guardduty.Detector;
* import com.pulumi.aws.guardduty.DetectorArgs;
* import com.pulumi.aws.guardduty.DetectorFeature;
* import com.pulumi.aws.guardduty.DetectorFeatureArgs;
* import com.pulumi.aws.guardduty.inputs.DetectorFeatureAdditionalConfigurationArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var example = new Detector("example", DetectorArgs.builder()
* .enable(true)
* .build());
* var eksRuntimeMonitoring = new DetectorFeature("eksRuntimeMonitoring", DetectorFeatureArgs.builder()
* .detectorId(example.id())
* .name("EKS_RUNTIME_MONITORING")
* .status("ENABLED")
* .additionalConfigurations(DetectorFeatureAdditionalConfigurationArgs.builder()
* .name("EKS_ADDON_MANAGEMENT")
* .status("ENABLED")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:guardduty:Detector
* properties:
* enable: true
* eksRuntimeMonitoring:
* type: aws:guardduty:DetectorFeature
* name: eks_runtime_monitoring
* properties:
* detectorId: ${example.id}
* name: EKS_RUNTIME_MONITORING
* status: ENABLED
* additionalConfigurations:
* - name: EKS_ADDON_MANAGEMENT
* status: ENABLED
* ```
*
*/
public class DetectorFeature internal constructor(
override val javaResource: com.pulumi.aws.guardduty.DetectorFeature,
) : KotlinCustomResource(javaResource, DetectorFeatureMapper) {
/**
* Additional feature configuration block for features`EKS_RUNTIME_MONITORING` or `RUNTIME_MONITORING`. See below.
*/
public val additionalConfigurations: Output>?
get() = javaResource.additionalConfigurations().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0.let({ args0 -> toKotlin(args0) }) })
}).orElse(null)
})
/**
* Amazon GuardDuty detector ID.
*/
public val detectorId: Output
get() = javaResource.detectorId().applyValue({ args0 -> args0 })
/**
* The name of the detector feature. Valid values: `S3_DATA_EVENTS`, `EKS_AUDIT_LOGS`, `EBS_MALWARE_PROTECTION`, `RDS_LOGIN_EVENTS`, `EKS_RUNTIME_MONITORING`, `LAMBDA_NETWORK_LOGS`, `RUNTIME_MONITORING`. Only one of two features `EKS_RUNTIME_MONITORING` or `RUNTIME_MONITORING` can be added, adding both features will cause an error. Refer to the [AWS Documentation](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_DetectorFeatureConfiguration.html) for the current list of supported values.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The status of the detector feature. Valid values: `ENABLED`, `DISABLED`.
*/
public val status: Output
get() = javaResource.status().applyValue({ args0 -> args0 })
}
public object DetectorFeatureMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.aws.guardduty.DetectorFeature::class == javaResource::class
override fun map(javaResource: Resource): DetectorFeature = DetectorFeature(
javaResource as
com.pulumi.aws.guardduty.DetectorFeature,
)
}
/**
* @see [DetectorFeature].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [DetectorFeature].
*/
public suspend fun detectorFeature(
name: String,
block: suspend DetectorFeatureResourceBuilder.() -> Unit,
): DetectorFeature {
val builder = DetectorFeatureResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [DetectorFeature].
* @param name The _unique_ name of the resulting resource.
*/
public fun detectorFeature(name: String): DetectorFeature {
val builder = DetectorFeatureResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy