1. Packages
  2. AWS
  3. API Docs
  4. inspector
  5. AssessmentTarget
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.inspector.AssessmentTarget

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    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,
    });
    
    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)
    
    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
    	})
    }
    
    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,
        });
    
    });
    
    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());
    
        }
    }
    
    resources:
      bar:
        type: aws:inspector:ResourceGroup
        properties:
          tags:
            Name: foo
            Env: bar
      foo:
        type: aws:inspector:AssessmentTarget
        properties:
          name: assessment target
          resourceGroupArn: ${bar.arn}
    

    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 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.

    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",
    });
    
    example, err := inspector.NewAssessmentTarget(ctx, "assessmentTargetResource", &inspector.AssessmentTargetArgs{
    	Name:             pulumi.String("string"),
    	ResourceGroupArn: pulumi.String("string"),
    })
    
    var assessmentTargetResource = new AssessmentTarget("assessmentTargetResource", AssessmentTargetArgs.builder()
        .name("string")
        .resourceGroupArn("string")
        .build());
    
    assessment_target_resource = aws.inspector.AssessmentTarget("assessmentTargetResource",
        name="string",
        resource_group_arn="string")
    
    const assessmentTargetResource = new aws.inspector.AssessmentTarget("assessmentTargetResource", {
        name: "string",
        resourceGroupArn: "string",
    });
    
    type: aws:inspector:AssessmentTarget
    properties:
        name: string
        resourceGroupArn: string
    

    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 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

    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
    

    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.
    aws logo
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi