aws.inspector.AssessmentTemplate
Explore with Pulumi AI
Provides an Inspector Classic Assessment Template
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.inspector.AssessmentTemplate("example", {
name: "example",
targetArn: exampleAwsInspectorAssessmentTarget.arn,
duration: 3600,
rulesPackageArns: [
"arn:aws:inspector:us-west-2:758058086616:rulespackage/0-9hgA516p",
"arn:aws:inspector:us-west-2:758058086616:rulespackage/0-H5hpSawc",
"arn:aws:inspector:us-west-2:758058086616:rulespackage/0-JJOtZiqQ",
"arn:aws:inspector:us-west-2:758058086616:rulespackage/0-vg5GGHSD",
],
eventSubscriptions: [{
event: "ASSESSMENT_RUN_COMPLETED",
topicArn: exampleAwsSnsTopic.arn,
}],
});
import pulumi
import pulumi_aws as aws
example = aws.inspector.AssessmentTemplate("example",
name="example",
target_arn=example_aws_inspector_assessment_target["arn"],
duration=3600,
rules_package_arns=[
"arn:aws:inspector:us-west-2:758058086616:rulespackage/0-9hgA516p",
"arn:aws:inspector:us-west-2:758058086616:rulespackage/0-H5hpSawc",
"arn:aws:inspector:us-west-2:758058086616:rulespackage/0-JJOtZiqQ",
"arn:aws:inspector:us-west-2:758058086616:rulespackage/0-vg5GGHSD",
],
event_subscriptions=[{
"event": "ASSESSMENT_RUN_COMPLETED",
"topic_arn": example_aws_sns_topic["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 {
_, err := inspector.NewAssessmentTemplate(ctx, "example", &inspector.AssessmentTemplateArgs{
Name: pulumi.String("example"),
TargetArn: pulumi.Any(exampleAwsInspectorAssessmentTarget.Arn),
Duration: pulumi.Int(3600),
RulesPackageArns: pulumi.StringArray{
pulumi.String("arn:aws:inspector:us-west-2:758058086616:rulespackage/0-9hgA516p"),
pulumi.String("arn:aws:inspector:us-west-2:758058086616:rulespackage/0-H5hpSawc"),
pulumi.String("arn:aws:inspector:us-west-2:758058086616:rulespackage/0-JJOtZiqQ"),
pulumi.String("arn:aws:inspector:us-west-2:758058086616:rulespackage/0-vg5GGHSD"),
},
EventSubscriptions: inspector.AssessmentTemplateEventSubscriptionArray{
&inspector.AssessmentTemplateEventSubscriptionArgs{
Event: pulumi.String("ASSESSMENT_RUN_COMPLETED"),
TopicArn: pulumi.Any(exampleAwsSnsTopic.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 example = new Aws.Inspector.AssessmentTemplate("example", new()
{
Name = "example",
TargetArn = exampleAwsInspectorAssessmentTarget.Arn,
Duration = 3600,
RulesPackageArns = new[]
{
"arn:aws:inspector:us-west-2:758058086616:rulespackage/0-9hgA516p",
"arn:aws:inspector:us-west-2:758058086616:rulespackage/0-H5hpSawc",
"arn:aws:inspector:us-west-2:758058086616:rulespackage/0-JJOtZiqQ",
"arn:aws:inspector:us-west-2:758058086616:rulespackage/0-vg5GGHSD",
},
EventSubscriptions = new[]
{
new Aws.Inspector.Inputs.AssessmentTemplateEventSubscriptionArgs
{
Event = "ASSESSMENT_RUN_COMPLETED",
TopicArn = exampleAwsSnsTopic.Arn,
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.inspector.AssessmentTemplate;
import com.pulumi.aws.inspector.AssessmentTemplateArgs;
import com.pulumi.aws.inspector.inputs.AssessmentTemplateEventSubscriptionArgs;
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 example = new AssessmentTemplate("example", AssessmentTemplateArgs.builder()
.name("example")
.targetArn(exampleAwsInspectorAssessmentTarget.arn())
.duration(3600)
.rulesPackageArns(
"arn:aws:inspector:us-west-2:758058086616:rulespackage/0-9hgA516p",
"arn:aws:inspector:us-west-2:758058086616:rulespackage/0-H5hpSawc",
"arn:aws:inspector:us-west-2:758058086616:rulespackage/0-JJOtZiqQ",
"arn:aws:inspector:us-west-2:758058086616:rulespackage/0-vg5GGHSD")
.eventSubscriptions(AssessmentTemplateEventSubscriptionArgs.builder()
.event("ASSESSMENT_RUN_COMPLETED")
.topicArn(exampleAwsSnsTopic.arn())
.build())
.build());
}
}
resources:
example:
type: aws:inspector:AssessmentTemplate
properties:
name: example
targetArn: ${exampleAwsInspectorAssessmentTarget.arn}
duration: 3600
rulesPackageArns:
- arn:aws:inspector:us-west-2:758058086616:rulespackage/0-9hgA516p
- arn:aws:inspector:us-west-2:758058086616:rulespackage/0-H5hpSawc
- arn:aws:inspector:us-west-2:758058086616:rulespackage/0-JJOtZiqQ
- arn:aws:inspector:us-west-2:758058086616:rulespackage/0-vg5GGHSD
eventSubscriptions:
- event: ASSESSMENT_RUN_COMPLETED
topicArn: ${exampleAwsSnsTopic.arn}
Create AssessmentTemplate Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AssessmentTemplate(name: string, args: AssessmentTemplateArgs, opts?: CustomResourceOptions);
@overload
def AssessmentTemplate(resource_name: str,
args: AssessmentTemplateArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AssessmentTemplate(resource_name: str,
opts: Optional[ResourceOptions] = None,
duration: Optional[int] = None,
rules_package_arns: Optional[Sequence[str]] = None,
target_arn: Optional[str] = None,
event_subscriptions: Optional[Sequence[AssessmentTemplateEventSubscriptionArgs]] = None,
name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewAssessmentTemplate(ctx *Context, name string, args AssessmentTemplateArgs, opts ...ResourceOption) (*AssessmentTemplate, error)
public AssessmentTemplate(string name, AssessmentTemplateArgs args, CustomResourceOptions? opts = null)
public AssessmentTemplate(String name, AssessmentTemplateArgs args)
public AssessmentTemplate(String name, AssessmentTemplateArgs args, CustomResourceOptions options)
type: aws:inspector:AssessmentTemplate
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 AssessmentTemplateArgs
- 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 AssessmentTemplateArgs
- 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 AssessmentTemplateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AssessmentTemplateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AssessmentTemplateArgs
- 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 assessmentTemplateResource = new Aws.Inspector.AssessmentTemplate("assessmentTemplateResource", new()
{
Duration = 0,
RulesPackageArns = new[]
{
"string",
},
TargetArn = "string",
EventSubscriptions = new[]
{
new Aws.Inspector.Inputs.AssessmentTemplateEventSubscriptionArgs
{
Event = "string",
TopicArn = "string",
},
},
Name = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := inspector.NewAssessmentTemplate(ctx, "assessmentTemplateResource", &inspector.AssessmentTemplateArgs{
Duration: pulumi.Int(0),
RulesPackageArns: pulumi.StringArray{
pulumi.String("string"),
},
TargetArn: pulumi.String("string"),
EventSubscriptions: inspector.AssessmentTemplateEventSubscriptionArray{
&inspector.AssessmentTemplateEventSubscriptionArgs{
Event: pulumi.String("string"),
TopicArn: pulumi.String("string"),
},
},
Name: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var assessmentTemplateResource = new AssessmentTemplate("assessmentTemplateResource", AssessmentTemplateArgs.builder()
.duration(0)
.rulesPackageArns("string")
.targetArn("string")
.eventSubscriptions(AssessmentTemplateEventSubscriptionArgs.builder()
.event("string")
.topicArn("string")
.build())
.name("string")
.tags(Map.of("string", "string"))
.build());
assessment_template_resource = aws.inspector.AssessmentTemplate("assessmentTemplateResource",
duration=0,
rules_package_arns=["string"],
target_arn="string",
event_subscriptions=[{
"event": "string",
"topicArn": "string",
}],
name="string",
tags={
"string": "string",
})
const assessmentTemplateResource = new aws.inspector.AssessmentTemplate("assessmentTemplateResource", {
duration: 0,
rulesPackageArns: ["string"],
targetArn: "string",
eventSubscriptions: [{
event: "string",
topicArn: "string",
}],
name: "string",
tags: {
string: "string",
},
});
type: aws:inspector:AssessmentTemplate
properties:
duration: 0
eventSubscriptions:
- event: string
topicArn: string
name: string
rulesPackageArns:
- string
tags:
string: string
targetArn: string
AssessmentTemplate 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 AssessmentTemplate resource accepts the following input properties:
- Duration int
- The duration of the inspector run.
- Rules
Package List<string>Arns - The rules to be used during the run.
- Target
Arn string - The assessment target ARN to attach the template to.
- Event
Subscriptions List<AssessmentTemplate Event Subscription> - A block that enables sending notifications about a specified assessment template event to a designated SNS topic. See Event Subscriptions for details.
- Name string
- The name of the assessment template.
- Dictionary<string, string>
- Key-value map of tags for the Inspector assessment template. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Duration int
- The duration of the inspector run.
- Rules
Package []stringArns - The rules to be used during the run.
- Target
Arn string - The assessment target ARN to attach the template to.
- Event
Subscriptions []AssessmentTemplate Event Subscription Args - A block that enables sending notifications about a specified assessment template event to a designated SNS topic. See Event Subscriptions for details.
- Name string
- The name of the assessment template.
- map[string]string
- Key-value map of tags for the Inspector assessment template. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- duration Integer
- The duration of the inspector run.
- rules
Package List<String>Arns - The rules to be used during the run.
- target
Arn String - The assessment target ARN to attach the template to.
- event
Subscriptions List<AssessmentTemplate Event Subscription> - A block that enables sending notifications about a specified assessment template event to a designated SNS topic. See Event Subscriptions for details.
- name String
- The name of the assessment template.
- Map<String,String>
- Key-value map of tags for the Inspector assessment template. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- duration number
- The duration of the inspector run.
- rules
Package string[]Arns - The rules to be used during the run.
- target
Arn string - The assessment target ARN to attach the template to.
- event
Subscriptions AssessmentTemplate Event Subscription[] - A block that enables sending notifications about a specified assessment template event to a designated SNS topic. See Event Subscriptions for details.
- name string
- The name of the assessment template.
- {[key: string]: string}
- Key-value map of tags for the Inspector assessment template. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- duration int
- The duration of the inspector run.
- rules_
package_ Sequence[str]arns - The rules to be used during the run.
- target_
arn str - The assessment target ARN to attach the template to.
- event_
subscriptions Sequence[AssessmentTemplate Event Subscription Args] - A block that enables sending notifications about a specified assessment template event to a designated SNS topic. See Event Subscriptions for details.
- name str
- The name of the assessment template.
- Mapping[str, str]
- Key-value map of tags for the Inspector assessment template. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- duration Number
- The duration of the inspector run.
- rules
Package List<String>Arns - The rules to be used during the run.
- target
Arn String - The assessment target ARN to attach the template to.
- event
Subscriptions List<Property Map> - A block that enables sending notifications about a specified assessment template event to a designated SNS topic. See Event Subscriptions for details.
- name String
- The name of the assessment template.
- Map<String>
- Key-value map of tags for the Inspector assessment template. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the AssessmentTemplate resource produces the following output properties:
Look up Existing AssessmentTemplate Resource
Get an existing AssessmentTemplate 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?: AssessmentTemplateState, opts?: CustomResourceOptions): AssessmentTemplate
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
duration: Optional[int] = None,
event_subscriptions: Optional[Sequence[AssessmentTemplateEventSubscriptionArgs]] = None,
name: Optional[str] = None,
rules_package_arns: Optional[Sequence[str]] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None,
target_arn: Optional[str] = None) -> AssessmentTemplate
func GetAssessmentTemplate(ctx *Context, name string, id IDInput, state *AssessmentTemplateState, opts ...ResourceOption) (*AssessmentTemplate, error)
public static AssessmentTemplate Get(string name, Input<string> id, AssessmentTemplateState? state, CustomResourceOptions? opts = null)
public static AssessmentTemplate get(String name, Output<String> id, AssessmentTemplateState 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.
- Arn string
- The template assessment ARN.
- Duration int
- The duration of the inspector run.
- Event
Subscriptions List<AssessmentTemplate Event Subscription> - A block that enables sending notifications about a specified assessment template event to a designated SNS topic. See Event Subscriptions for details.
- Name string
- The name of the assessment template.
- Rules
Package List<string>Arns - The rules to be used during the run.
- Dictionary<string, string>
- Key-value map of tags for the Inspector assessment template. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - Target
Arn string - The assessment target ARN to attach the template to.
- Arn string
- The template assessment ARN.
- Duration int
- The duration of the inspector run.
- Event
Subscriptions []AssessmentTemplate Event Subscription Args - A block that enables sending notifications about a specified assessment template event to a designated SNS topic. See Event Subscriptions for details.
- Name string
- The name of the assessment template.
- Rules
Package []stringArns - The rules to be used during the run.
- map[string]string
- Key-value map of tags for the Inspector assessment template. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - Target
Arn string - The assessment target ARN to attach the template to.
- arn String
- The template assessment ARN.
- duration Integer
- The duration of the inspector run.
- event
Subscriptions List<AssessmentTemplate Event Subscription> - A block that enables sending notifications about a specified assessment template event to a designated SNS topic. See Event Subscriptions for details.
- name String
- The name of the assessment template.
- rules
Package List<String>Arns - The rules to be used during the run.
- Map<String,String>
- Key-value map of tags for the Inspector assessment template. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - target
Arn String - The assessment target ARN to attach the template to.
- arn string
- The template assessment ARN.
- duration number
- The duration of the inspector run.
- event
Subscriptions AssessmentTemplate Event Subscription[] - A block that enables sending notifications about a specified assessment template event to a designated SNS topic. See Event Subscriptions for details.
- name string
- The name of the assessment template.
- rules
Package string[]Arns - The rules to be used during the run.
- {[key: string]: string}
- Key-value map of tags for the Inspector assessment template. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - target
Arn string - The assessment target ARN to attach the template to.
- arn str
- The template assessment ARN.
- duration int
- The duration of the inspector run.
- event_
subscriptions Sequence[AssessmentTemplate Event Subscription Args] - A block that enables sending notifications about a specified assessment template event to a designated SNS topic. See Event Subscriptions for details.
- name str
- The name of the assessment template.
- rules_
package_ Sequence[str]arns - The rules to be used during the run.
- Mapping[str, str]
- Key-value map of tags for the Inspector assessment template. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - target_
arn str - The assessment target ARN to attach the template to.
- arn String
- The template assessment ARN.
- duration Number
- The duration of the inspector run.
- event
Subscriptions List<Property Map> - A block that enables sending notifications about a specified assessment template event to a designated SNS topic. See Event Subscriptions for details.
- name String
- The name of the assessment template.
- rules
Package List<String>Arns - The rules to be used during the run.
- Map<String>
- Key-value map of tags for the Inspector assessment template. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - target
Arn String - The assessment target ARN to attach the template to.
Supporting Types
AssessmentTemplateEventSubscription, AssessmentTemplateEventSubscriptionArgs
Import
Using pulumi import
, import aws_inspector_assessment_template
using the template assessment ARN. For example:
$ pulumi import aws:inspector/assessmentTemplate:AssessmentTemplate example arn:aws:inspector:us-west-2:123456789012:target/0-9IaAzhGR/template/0-WEcjR8CH
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.