1. Packages
  2. AWS
  3. API Docs
  4. inspector
  5. AssessmentTarget
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.inspector.AssessmentTarget

Explore with Pulumi AI

Provides an Inspector Classic Assessment Target

Example Usage

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", {
    name: "assessment target",
    resourceGroupArn: bar.arn,
});
Copy
import pulumi
import pulumi_aws as aws

bar = aws.inspector.ResourceGroup("bar", tags={
    "Name": "foo",
    "Env": "bar",
})
foo = aws.inspector.AssessmentTarget("foo",
    name="assessment target",
    resource_group_arn=bar.arn)
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/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{
			Name:             pulumi.String("assessment target"),
			ResourceGroupArn: bar.Arn,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
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()
    {
        Name = "assessment target",
        ResourceGroupArn = bar.Arn,
    });

});
Copy
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()
            .name("assessment target")
            .resourceGroupArn(bar.arn())
            .build());

    }
}
Copy
resources:
  bar:
    type: aws:inspector:ResourceGroup
    properties:
      tags:
        Name: foo
        Env: bar
  foo:
    type: aws:inspector:AssessmentTarget
    properties:
      name: assessment target
      resourceGroupArn: ${bar.arn}
Copy

Create AssessmentTarget Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new AssessmentTarget(name: string, args?: AssessmentTargetArgs, opts?: CustomResourceOptions);
@overload
def AssessmentTarget(resource_name: str,
                     args: Optional[AssessmentTargetArgs] = None,
                     opts: Optional[ResourceOptions] = None)

@overload
def AssessmentTarget(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     name: Optional[str] = None,
                     resource_group_arn: Optional[str] = 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.

Parameters

name This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. String
The unique name of the resource.
args This property is required. AssessmentTargetArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var assessmentTargetResource = new Aws.Inspector.AssessmentTarget("assessmentTargetResource", new()
{
    Name = "string",
    ResourceGroupArn = "string",
});
Copy
example, err := inspector.NewAssessmentTarget(ctx, "assessmentTargetResource", &inspector.AssessmentTargetArgs{
	Name:             pulumi.String("string"),
	ResourceGroupArn: pulumi.String("string"),
})
Copy
var assessmentTargetResource = new AssessmentTarget("assessmentTargetResource", AssessmentTargetArgs.builder()
    .name("string")
    .resourceGroupArn("string")
    .build());
Copy
assessment_target_resource = aws.inspector.AssessmentTarget("assessmentTargetResource",
    name="string",
    resource_group_arn="string")
Copy
const assessmentTargetResource = new aws.inspector.AssessmentTarget("assessmentTargetResource", {
    name: "string",
    resourceGroupArn: "string",
});
Copy
type: aws:inspector:AssessmentTarget
properties:
    name: string
    resourceGroupArn: string
Copy

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

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The AssessmentTarget resource accepts the following input properties:

Name Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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)
resources:  _:    type: aws:inspector:AssessmentTarget    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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

Using pulumi import, import Inspector Classic Assessment Targets using their Amazon Resource Name (ARN). For example:

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

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.