aws logo
AWS Classic v5.33.0, Mar 24 23

aws.inspector.AssessmentTarget

Provides a Inspector assessment target

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var bar = new Aws.Inspector.ResourceGroup("bar", new()
    {
        Tags = 
        {
            { "Name", "foo" },
            { "Env", "bar" },
        },
    });

    var foo = new Aws.Inspector.AssessmentTarget("foo", new()
    {
        ResourceGroupArn = bar.Arn,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/inspector"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		bar, err := inspector.NewResourceGroup(ctx, "bar", &inspector.ResourceGroupArgs{
			Tags: pulumi.StringMap{
				"Name": pulumi.String("foo"),
				"Env":  pulumi.String("bar"),
			},
		})
		if err != nil {
			return err
		}
		_, err = inspector.NewAssessmentTarget(ctx, "foo", &inspector.AssessmentTargetArgs{
			ResourceGroupArn: bar.Arn,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.inspector.ResourceGroup;
import com.pulumi.aws.inspector.ResourceGroupArgs;
import com.pulumi.aws.inspector.AssessmentTarget;
import com.pulumi.aws.inspector.AssessmentTargetArgs;
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 bar = new ResourceGroup("bar", ResourceGroupArgs.builder()        
            .tags(Map.ofEntries(
                Map.entry("Name", "foo"),
                Map.entry("Env", "bar")
            ))
            .build());

        var foo = new AssessmentTarget("foo", AssessmentTargetArgs.builder()        
            .resourceGroupArn(bar.arn())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

bar = aws.inspector.ResourceGroup("bar", tags={
    "Name": "foo",
    "Env": "bar",
})
foo = aws.inspector.AssessmentTarget("foo", resource_group_arn=bar.arn)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const bar = new aws.inspector.ResourceGroup("bar", {tags: {
    Name: "foo",
    Env: "bar",
}});
const foo = new aws.inspector.AssessmentTarget("foo", {resourceGroupArn: bar.arn});
resources:
  bar:
    type: aws:inspector:ResourceGroup
    properties:
      tags:
        Name: foo
        Env: bar
  foo:
    type: aws:inspector:AssessmentTarget
    properties:
      resourceGroupArn: ${bar.arn}

Create AssessmentTarget Resource

new AssessmentTarget(name: string, args?: AssessmentTargetArgs, opts?: CustomResourceOptions);
@overload
def AssessmentTarget(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     name: Optional[str] = None,
                     resource_group_arn: Optional[str] = None)
@overload
def AssessmentTarget(resource_name: str,
                     args: Optional[AssessmentTargetArgs] = None,
                     opts: Optional[ResourceOptions] = None)
func NewAssessmentTarget(ctx *Context, name string, args *AssessmentTargetArgs, opts ...ResourceOption) (*AssessmentTarget, error)
public AssessmentTarget(string name, AssessmentTargetArgs? args = null, CustomResourceOptions? opts = null)
public AssessmentTarget(String name, AssessmentTargetArgs args)
public AssessmentTarget(String name, AssessmentTargetArgs args, CustomResourceOptions options)
type: aws:inspector:AssessmentTarget
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args AssessmentTargetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args AssessmentTargetArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args AssessmentTargetArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AssessmentTargetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args AssessmentTargetArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

AssessmentTarget Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The AssessmentTarget resource accepts the following input properties:

Name string

The name of the assessment target.

ResourceGroupArn string

Inspector Resource Group Amazon Resource Name (ARN) stating tags for instance matching. If not specified, all EC2 instances in the current AWS account and region are included in the assessment target.

Name string

The name of the assessment target.

ResourceGroupArn string

Inspector Resource Group Amazon Resource Name (ARN) stating tags for instance matching. If not specified, all EC2 instances in the current AWS account and region are included in the assessment target.

name String

The name of the assessment target.

resourceGroupArn String

Inspector Resource Group Amazon Resource Name (ARN) stating tags for instance matching. If not specified, all EC2 instances in the current AWS account and region are included in the assessment target.

name string

The name of the assessment target.

resourceGroupArn string

Inspector Resource Group Amazon Resource Name (ARN) stating tags for instance matching. If not specified, all EC2 instances in the current AWS account and region are included in the assessment target.

name str

The name of the assessment target.

resource_group_arn str

Inspector Resource Group Amazon Resource Name (ARN) stating tags for instance matching. If not specified, all EC2 instances in the current AWS account and region are included in the assessment target.

name String

The name of the assessment target.

resourceGroupArn String

Inspector Resource Group Amazon Resource Name (ARN) stating tags for instance matching. If not specified, all EC2 instances in the current AWS account and region are included in the assessment target.

Outputs

All input properties are implicitly available as output properties. Additionally, the AssessmentTarget resource produces the following output properties:

Arn string

The target assessment ARN.

Id string

The provider-assigned unique ID for this managed resource.

Arn string

The target assessment ARN.

Id string

The provider-assigned unique ID for this managed resource.

arn String

The target assessment ARN.

id String

The provider-assigned unique ID for this managed resource.

arn string

The target assessment ARN.

id string

The provider-assigned unique ID for this managed resource.

arn str

The target assessment ARN.

id str

The provider-assigned unique ID for this managed resource.

arn String

The target assessment ARN.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing AssessmentTarget Resource

Get an existing AssessmentTarget resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: AssessmentTargetState, opts?: CustomResourceOptions): AssessmentTarget
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        name: Optional[str] = None,
        resource_group_arn: Optional[str] = None) -> AssessmentTarget
func GetAssessmentTarget(ctx *Context, name string, id IDInput, state *AssessmentTargetState, opts ...ResourceOption) (*AssessmentTarget, error)
public static AssessmentTarget Get(string name, Input<string> id, AssessmentTargetState? state, CustomResourceOptions? opts = null)
public static AssessmentTarget get(String name, Output<String> id, AssessmentTargetState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Arn string

The target assessment ARN.

Name string

The name of the assessment target.

ResourceGroupArn string

Inspector Resource Group Amazon Resource Name (ARN) stating tags for instance matching. If not specified, all EC2 instances in the current AWS account and region are included in the assessment target.

Arn string

The target assessment ARN.

Name string

The name of the assessment target.

ResourceGroupArn string

Inspector Resource Group Amazon Resource Name (ARN) stating tags for instance matching. If not specified, all EC2 instances in the current AWS account and region are included in the assessment target.

arn String

The target assessment ARN.

name String

The name of the assessment target.

resourceGroupArn String

Inspector Resource Group Amazon Resource Name (ARN) stating tags for instance matching. If not specified, all EC2 instances in the current AWS account and region are included in the assessment target.

arn string

The target assessment ARN.

name string

The name of the assessment target.

resourceGroupArn string

Inspector Resource Group Amazon Resource Name (ARN) stating tags for instance matching. If not specified, all EC2 instances in the current AWS account and region are included in the assessment target.

arn str

The target assessment ARN.

name str

The name of the assessment target.

resource_group_arn str

Inspector Resource Group Amazon Resource Name (ARN) stating tags for instance matching. If not specified, all EC2 instances in the current AWS account and region are included in the assessment target.

arn String

The target assessment ARN.

name String

The name of the assessment target.

resourceGroupArn String

Inspector Resource Group Amazon Resource Name (ARN) stating tags for instance matching. If not specified, all EC2 instances in the current AWS account and region are included in the assessment target.

Import

Inspector Assessment Targets can be imported via their Amazon Resource Name (ARN), e.g.,

 $ pulumi import aws:inspector/assessmentTarget:AssessmentTarget example arn:aws:inspector:us-east-1:123456789012:target/0-xxxxxxx

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.