github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/inspector/assessmentTarget.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package inspector
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Provides an Inspector Classic Assessment Target
    15  //
    16  // ## Example Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/inspector"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			bar, err := inspector.NewResourceGroup(ctx, "bar", &inspector.ResourceGroupArgs{
    32  //				Tags: pulumi.StringMap{
    33  //					"Name": pulumi.String("foo"),
    34  //					"Env":  pulumi.String("bar"),
    35  //				},
    36  //			})
    37  //			if err != nil {
    38  //				return err
    39  //			}
    40  //			_, err = inspector.NewAssessmentTarget(ctx, "foo", &inspector.AssessmentTargetArgs{
    41  //				Name:             pulumi.String("assessment target"),
    42  //				ResourceGroupArn: bar.Arn,
    43  //			})
    44  //			if err != nil {
    45  //				return err
    46  //			}
    47  //			return nil
    48  //		})
    49  //	}
    50  //
    51  // ```
    52  // <!--End PulumiCodeChooser -->
    53  //
    54  // ## Import
    55  //
    56  // Using `pulumi import`, import Inspector Classic Assessment Targets using their Amazon Resource Name (ARN). For example:
    57  //
    58  // ```sh
    59  // $ pulumi import aws:inspector/assessmentTarget:AssessmentTarget example arn:aws:inspector:us-east-1:123456789012:target/0-xxxxxxx
    60  // ```
    61  type AssessmentTarget struct {
    62  	pulumi.CustomResourceState
    63  
    64  	// The target assessment ARN.
    65  	Arn pulumi.StringOutput `pulumi:"arn"`
    66  	// The name of the assessment target.
    67  	Name pulumi.StringOutput `pulumi:"name"`
    68  	// 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.
    69  	ResourceGroupArn pulumi.StringPtrOutput `pulumi:"resourceGroupArn"`
    70  }
    71  
    72  // NewAssessmentTarget registers a new resource with the given unique name, arguments, and options.
    73  func NewAssessmentTarget(ctx *pulumi.Context,
    74  	name string, args *AssessmentTargetArgs, opts ...pulumi.ResourceOption) (*AssessmentTarget, error) {
    75  	if args == nil {
    76  		args = &AssessmentTargetArgs{}
    77  	}
    78  
    79  	opts = internal.PkgResourceDefaultOpts(opts)
    80  	var resource AssessmentTarget
    81  	err := ctx.RegisterResource("aws:inspector/assessmentTarget:AssessmentTarget", name, args, &resource, opts...)
    82  	if err != nil {
    83  		return nil, err
    84  	}
    85  	return &resource, nil
    86  }
    87  
    88  // GetAssessmentTarget gets an existing AssessmentTarget resource's state with the given name, ID, and optional
    89  // state properties that are used to uniquely qualify the lookup (nil if not required).
    90  func GetAssessmentTarget(ctx *pulumi.Context,
    91  	name string, id pulumi.IDInput, state *AssessmentTargetState, opts ...pulumi.ResourceOption) (*AssessmentTarget, error) {
    92  	var resource AssessmentTarget
    93  	err := ctx.ReadResource("aws:inspector/assessmentTarget:AssessmentTarget", name, id, state, &resource, opts...)
    94  	if err != nil {
    95  		return nil, err
    96  	}
    97  	return &resource, nil
    98  }
    99  
   100  // Input properties used for looking up and filtering AssessmentTarget resources.
   101  type assessmentTargetState struct {
   102  	// The target assessment ARN.
   103  	Arn *string `pulumi:"arn"`
   104  	// The name of the assessment target.
   105  	Name *string `pulumi:"name"`
   106  	// 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.
   107  	ResourceGroupArn *string `pulumi:"resourceGroupArn"`
   108  }
   109  
   110  type AssessmentTargetState struct {
   111  	// The target assessment ARN.
   112  	Arn pulumi.StringPtrInput
   113  	// The name of the assessment target.
   114  	Name pulumi.StringPtrInput
   115  	// 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.
   116  	ResourceGroupArn pulumi.StringPtrInput
   117  }
   118  
   119  func (AssessmentTargetState) ElementType() reflect.Type {
   120  	return reflect.TypeOf((*assessmentTargetState)(nil)).Elem()
   121  }
   122  
   123  type assessmentTargetArgs struct {
   124  	// The name of the assessment target.
   125  	Name *string `pulumi:"name"`
   126  	// 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.
   127  	ResourceGroupArn *string `pulumi:"resourceGroupArn"`
   128  }
   129  
   130  // The set of arguments for constructing a AssessmentTarget resource.
   131  type AssessmentTargetArgs struct {
   132  	// The name of the assessment target.
   133  	Name pulumi.StringPtrInput
   134  	// 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.
   135  	ResourceGroupArn pulumi.StringPtrInput
   136  }
   137  
   138  func (AssessmentTargetArgs) ElementType() reflect.Type {
   139  	return reflect.TypeOf((*assessmentTargetArgs)(nil)).Elem()
   140  }
   141  
   142  type AssessmentTargetInput interface {
   143  	pulumi.Input
   144  
   145  	ToAssessmentTargetOutput() AssessmentTargetOutput
   146  	ToAssessmentTargetOutputWithContext(ctx context.Context) AssessmentTargetOutput
   147  }
   148  
   149  func (*AssessmentTarget) ElementType() reflect.Type {
   150  	return reflect.TypeOf((**AssessmentTarget)(nil)).Elem()
   151  }
   152  
   153  func (i *AssessmentTarget) ToAssessmentTargetOutput() AssessmentTargetOutput {
   154  	return i.ToAssessmentTargetOutputWithContext(context.Background())
   155  }
   156  
   157  func (i *AssessmentTarget) ToAssessmentTargetOutputWithContext(ctx context.Context) AssessmentTargetOutput {
   158  	return pulumi.ToOutputWithContext(ctx, i).(AssessmentTargetOutput)
   159  }
   160  
   161  // AssessmentTargetArrayInput is an input type that accepts AssessmentTargetArray and AssessmentTargetArrayOutput values.
   162  // You can construct a concrete instance of `AssessmentTargetArrayInput` via:
   163  //
   164  //	AssessmentTargetArray{ AssessmentTargetArgs{...} }
   165  type AssessmentTargetArrayInput interface {
   166  	pulumi.Input
   167  
   168  	ToAssessmentTargetArrayOutput() AssessmentTargetArrayOutput
   169  	ToAssessmentTargetArrayOutputWithContext(context.Context) AssessmentTargetArrayOutput
   170  }
   171  
   172  type AssessmentTargetArray []AssessmentTargetInput
   173  
   174  func (AssessmentTargetArray) ElementType() reflect.Type {
   175  	return reflect.TypeOf((*[]*AssessmentTarget)(nil)).Elem()
   176  }
   177  
   178  func (i AssessmentTargetArray) ToAssessmentTargetArrayOutput() AssessmentTargetArrayOutput {
   179  	return i.ToAssessmentTargetArrayOutputWithContext(context.Background())
   180  }
   181  
   182  func (i AssessmentTargetArray) ToAssessmentTargetArrayOutputWithContext(ctx context.Context) AssessmentTargetArrayOutput {
   183  	return pulumi.ToOutputWithContext(ctx, i).(AssessmentTargetArrayOutput)
   184  }
   185  
   186  // AssessmentTargetMapInput is an input type that accepts AssessmentTargetMap and AssessmentTargetMapOutput values.
   187  // You can construct a concrete instance of `AssessmentTargetMapInput` via:
   188  //
   189  //	AssessmentTargetMap{ "key": AssessmentTargetArgs{...} }
   190  type AssessmentTargetMapInput interface {
   191  	pulumi.Input
   192  
   193  	ToAssessmentTargetMapOutput() AssessmentTargetMapOutput
   194  	ToAssessmentTargetMapOutputWithContext(context.Context) AssessmentTargetMapOutput
   195  }
   196  
   197  type AssessmentTargetMap map[string]AssessmentTargetInput
   198  
   199  func (AssessmentTargetMap) ElementType() reflect.Type {
   200  	return reflect.TypeOf((*map[string]*AssessmentTarget)(nil)).Elem()
   201  }
   202  
   203  func (i AssessmentTargetMap) ToAssessmentTargetMapOutput() AssessmentTargetMapOutput {
   204  	return i.ToAssessmentTargetMapOutputWithContext(context.Background())
   205  }
   206  
   207  func (i AssessmentTargetMap) ToAssessmentTargetMapOutputWithContext(ctx context.Context) AssessmentTargetMapOutput {
   208  	return pulumi.ToOutputWithContext(ctx, i).(AssessmentTargetMapOutput)
   209  }
   210  
   211  type AssessmentTargetOutput struct{ *pulumi.OutputState }
   212  
   213  func (AssessmentTargetOutput) ElementType() reflect.Type {
   214  	return reflect.TypeOf((**AssessmentTarget)(nil)).Elem()
   215  }
   216  
   217  func (o AssessmentTargetOutput) ToAssessmentTargetOutput() AssessmentTargetOutput {
   218  	return o
   219  }
   220  
   221  func (o AssessmentTargetOutput) ToAssessmentTargetOutputWithContext(ctx context.Context) AssessmentTargetOutput {
   222  	return o
   223  }
   224  
   225  // The target assessment ARN.
   226  func (o AssessmentTargetOutput) Arn() pulumi.StringOutput {
   227  	return o.ApplyT(func(v *AssessmentTarget) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   228  }
   229  
   230  // The name of the assessment target.
   231  func (o AssessmentTargetOutput) Name() pulumi.StringOutput {
   232  	return o.ApplyT(func(v *AssessmentTarget) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   233  }
   234  
   235  // 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.
   236  func (o AssessmentTargetOutput) ResourceGroupArn() pulumi.StringPtrOutput {
   237  	return o.ApplyT(func(v *AssessmentTarget) pulumi.StringPtrOutput { return v.ResourceGroupArn }).(pulumi.StringPtrOutput)
   238  }
   239  
   240  type AssessmentTargetArrayOutput struct{ *pulumi.OutputState }
   241  
   242  func (AssessmentTargetArrayOutput) ElementType() reflect.Type {
   243  	return reflect.TypeOf((*[]*AssessmentTarget)(nil)).Elem()
   244  }
   245  
   246  func (o AssessmentTargetArrayOutput) ToAssessmentTargetArrayOutput() AssessmentTargetArrayOutput {
   247  	return o
   248  }
   249  
   250  func (o AssessmentTargetArrayOutput) ToAssessmentTargetArrayOutputWithContext(ctx context.Context) AssessmentTargetArrayOutput {
   251  	return o
   252  }
   253  
   254  func (o AssessmentTargetArrayOutput) Index(i pulumi.IntInput) AssessmentTargetOutput {
   255  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AssessmentTarget {
   256  		return vs[0].([]*AssessmentTarget)[vs[1].(int)]
   257  	}).(AssessmentTargetOutput)
   258  }
   259  
   260  type AssessmentTargetMapOutput struct{ *pulumi.OutputState }
   261  
   262  func (AssessmentTargetMapOutput) ElementType() reflect.Type {
   263  	return reflect.TypeOf((*map[string]*AssessmentTarget)(nil)).Elem()
   264  }
   265  
   266  func (o AssessmentTargetMapOutput) ToAssessmentTargetMapOutput() AssessmentTargetMapOutput {
   267  	return o
   268  }
   269  
   270  func (o AssessmentTargetMapOutput) ToAssessmentTargetMapOutputWithContext(ctx context.Context) AssessmentTargetMapOutput {
   271  	return o
   272  }
   273  
   274  func (o AssessmentTargetMapOutput) MapIndex(k pulumi.StringInput) AssessmentTargetOutput {
   275  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AssessmentTarget {
   276  		return vs[0].(map[string]*AssessmentTarget)[vs[1].(string)]
   277  	}).(AssessmentTargetOutput)
   278  }
   279  
   280  func init() {
   281  	pulumi.RegisterInputType(reflect.TypeOf((*AssessmentTargetInput)(nil)).Elem(), &AssessmentTarget{})
   282  	pulumi.RegisterInputType(reflect.TypeOf((*AssessmentTargetArrayInput)(nil)).Elem(), AssessmentTargetArray{})
   283  	pulumi.RegisterInputType(reflect.TypeOf((*AssessmentTargetMapInput)(nil)).Elem(), AssessmentTargetMap{})
   284  	pulumi.RegisterOutputType(AssessmentTargetOutput{})
   285  	pulumi.RegisterOutputType(AssessmentTargetArrayOutput{})
   286  	pulumi.RegisterOutputType(AssessmentTargetMapOutput{})
   287  }