MalwareProtectionPlan class
Provides a resource to manage a GuardDuty malware protection plan.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.guardduty.MalwareProtectionPlan("example", {
protectedResource: {
s3Bucket: {
bucketName: exampleAwsS3Bucket.id,
objectPrefixes: [
"example1",
"example2",
],
},
},
actions: [{
tagging: [{
status: "ENABLED",
}],
}],
role: exampleAwsIamRole.arn,
tags: {
Name: "example",
},
});
import pulumi
import pulumi_aws as aws
example = aws.guardduty.MalwareProtectionPlan("example",
protected_resource={
"s3_bucket": {
"bucket_name": example_aws_s3_bucket["id"],
"object_prefixes": [
"example1",
"example2",
],
},
},
actions=[{
"tagging": [{
"status": "ENABLED",
}],
}],
role=example_aws_iam_role["arn"],
tags={
"Name": "example",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.GuardDuty.MalwareProtectionPlan("example", new()
{
ProtectedResource = new Aws.GuardDuty.Inputs.MalwareProtectionPlanProtectedResourceArgs
{
S3Bucket = new Aws.GuardDuty.Inputs.MalwareProtectionPlanProtectedResourceS3BucketArgs
{
BucketName = exampleAwsS3Bucket.Id,
ObjectPrefixes = new[]
{
"example1",
"example2",
},
},
},
Actions = new[]
{
new Aws.GuardDuty.Inputs.MalwareProtectionPlanActionArgs
{
Tagging = new[]
{
{
{ "status", "ENABLED" },
},
},
},
},
Role = exampleAwsIamRole.Arn,
Tags =
{
{ "Name", "example" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/guardduty"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := guardduty.NewMalwareProtectionPlan(ctx, "example", &guardduty.MalwareProtectionPlanArgs{
ProtectedResource: &guardduty.MalwareProtectionPlanProtectedResourceArgs{
S3Bucket: &guardduty.MalwareProtectionPlanProtectedResourceS3BucketArgs{
BucketName: pulumi.Any(exampleAwsS3Bucket.Id),
ObjectPrefixes: pulumi.StringArray{
pulumi.String("example1"),
pulumi.String("example2"),
},
},
},
Actions: guardduty.MalwareProtectionPlanActionArray{
&guardduty.MalwareProtectionPlanActionArgs{
Tagging: []map[string]string{
{
"status": "ENABLED",
},
},
},
},
Role: pulumi.Any(exampleAwsIamRole.Arn),
Tags: pulumi.StringMap{
"Name": pulumi.String("example"),
},
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_guardduty_malwareprotectionplan" "example" {
protected_resource = {
s3_bucket = {
bucket_name = exampleAwsS3Bucket.id
object_prefixes = ["example1", "example2"]
}
}
actions {
tagging = [{
"status" = "ENABLED"
}]
}
role = exampleAwsIamRole.arn
tags = {
"Name" = "example"
}
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.guardduty.MalwareProtectionPlan;
import com.pulumi.aws.guardduty.MalwareProtectionPlanArgs;
import com.pulumi.aws.guardduty.inputs.MalwareProtectionPlanProtectedResourceArgs;
import com.pulumi.aws.guardduty.inputs.MalwareProtectionPlanProtectedResourceS3BucketArgs;
import com.pulumi.aws.guardduty.inputs.MalwareProtectionPlanActionArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 MalwareProtectionPlan("example", MalwareProtectionPlanArgs.builder()
.protectedResource(MalwareProtectionPlanProtectedResourceArgs.builder()
.s3Bucket(MalwareProtectionPlanProtectedResourceS3BucketArgs.builder()
.bucketName(exampleAwsS3Bucket.id())
.objectPrefixes(
"example1",
"example2")
.build())
.build())
.actions(MalwareProtectionPlanActionArgs.builder()
.tagging(Arrays.asList(Map.of("status", "ENABLED")))
.build())
.role(exampleAwsIamRole.arn())
.tags(Map.of("Name", "example"))
.build());
}
}
resources:
example:
type: aws:guardduty:MalwareProtectionPlan
properties:
protectedResource:
s3Bucket:
bucketName: ${exampleAwsS3Bucket.id}
objectPrefixes:
- example1
- example2
actions:
- tagging:
- status: ENABLED
role: ${exampleAwsIamRole.arn}
tags:
Name: example
Import
Using pulumi import, import GuardDuty malware protection plans using their IDs. For example:
$ pulumi import aws:guardduty/malwareProtectionPlan:MalwareProtectionPlan example 1234567890abcdef0123
Constructors
- MalwareProtectionPlan(String name, {MalwareProtectionPlanArgs? args, CustomResourceOptions? options})
-
Creates a new MalwareProtectionPlan.
nameThe Pulumi resource name.argsArguments used to configure this MalwareProtectionPlan. The set of arguments for MalwareProtectionPlan.optionsResource options controlling this resource's behavior. - MalwareProtectionPlan.reference(String urn)
- Creates a typed reference to an existing MalwareProtectionPlan resource.
Properties
-
actions
↔ Output<
List< MalwareProtectionPlanAction> > -
Information about whether the tags will be added to the S3 object after scanning. See
actionsbelow.latefinal -
arn
↔ Output<
String> -
The ARN of the GuardDuty malware protection plan
latefinal
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
createdAt
↔ Output<
String> -
The timestamp when the Malware Protection plan resource was created.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
protectedResource
↔ Output<
MalwareProtectionPlanProtectedResource> -
Information about the protected resource that is associated with the created Malware Protection plan. Presently, S3Bucket is the only supported protected resource. See
protectedResourcebelow.latefinal -
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
-
role
↔ Output<
String> -
ARN of IAM role that includes the permissions required to scan and add tags to the associated protected resource.
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
status
↔ Output<
String> -
The GuardDuty malware protection plan status. Valid values are
ACTIVE,WARNING, andERROR.latefinal -
Key-value mapping of resource tags. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.latefinal -
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {MalwareProtectionPlanState? state, CustomResourceOptions? options}) → MalwareProtectionPlan -
Gets an existing MalwareProtectionPlan resource's state with the given
nameandid.