aws.accessanalyzer.ArchiveRule
Explore with Pulumi AI
Resource for managing an AWS AccessAnalyzer Archive Rule.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.accessanalyzer.ArchiveRule("example", {
analyzerName: "example-analyzer",
ruleName: "example-rule",
filters: [
{
criteria: "condition.aws:UserId",
eqs: ["userid"],
},
{
criteria: "error",
exists: "true",
},
{
criteria: "isPublic",
eqs: ["false"],
},
],
});
import pulumi
import pulumi_aws as aws
example = aws.accessanalyzer.ArchiveRule("example",
analyzer_name="example-analyzer",
rule_name="example-rule",
filters=[
{
"criteria": "condition.aws:UserId",
"eqs": ["userid"],
},
{
"criteria": "error",
"exists": "true",
},
{
"criteria": "isPublic",
"eqs": ["false"],
},
])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/accessanalyzer"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := accessanalyzer.NewArchiveRule(ctx, "example", &accessanalyzer.ArchiveRuleArgs{
AnalyzerName: pulumi.String("example-analyzer"),
RuleName: pulumi.String("example-rule"),
Filters: accessanalyzer.ArchiveRuleFilterArray{
&accessanalyzer.ArchiveRuleFilterArgs{
Criteria: pulumi.String("condition.aws:UserId"),
Eqs: pulumi.StringArray{
pulumi.String("userid"),
},
},
&accessanalyzer.ArchiveRuleFilterArgs{
Criteria: pulumi.String("error"),
Exists: pulumi.String("true"),
},
&accessanalyzer.ArchiveRuleFilterArgs{
Criteria: pulumi.String("isPublic"),
Eqs: pulumi.StringArray{
pulumi.String("false"),
},
},
},
})
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.AccessAnalyzer.ArchiveRule("example", new()
{
AnalyzerName = "example-analyzer",
RuleName = "example-rule",
Filters = new[]
{
new Aws.AccessAnalyzer.Inputs.ArchiveRuleFilterArgs
{
Criteria = "condition.aws:UserId",
Eqs = new[]
{
"userid",
},
},
new Aws.AccessAnalyzer.Inputs.ArchiveRuleFilterArgs
{
Criteria = "error",
Exists = "true",
},
new Aws.AccessAnalyzer.Inputs.ArchiveRuleFilterArgs
{
Criteria = "isPublic",
Eqs = new[]
{
"false",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.accessanalyzer.ArchiveRule;
import com.pulumi.aws.accessanalyzer.ArchiveRuleArgs;
import com.pulumi.aws.accessanalyzer.inputs.ArchiveRuleFilterArgs;
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 ArchiveRule("example", ArchiveRuleArgs.builder()
.analyzerName("example-analyzer")
.ruleName("example-rule")
.filters(
ArchiveRuleFilterArgs.builder()
.criteria("condition.aws:UserId")
.eqs("userid")
.build(),
ArchiveRuleFilterArgs.builder()
.criteria("error")
.exists(true)
.build(),
ArchiveRuleFilterArgs.builder()
.criteria("isPublic")
.eqs("false")
.build())
.build());
}
}
resources:
example:
type: aws:accessanalyzer:ArchiveRule
properties:
analyzerName: example-analyzer
ruleName: example-rule
filters:
- criteria: condition.aws:UserId
eqs:
- userid
- criteria: error
exists: true
- criteria: isPublic
eqs:
- 'false'
Create ArchiveRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ArchiveRule(name: string, args: ArchiveRuleArgs, opts?: CustomResourceOptions);
@overload
def ArchiveRule(resource_name: str,
args: ArchiveRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ArchiveRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
analyzer_name: Optional[str] = None,
filters: Optional[Sequence[ArchiveRuleFilterArgs]] = None,
rule_name: Optional[str] = None)
func NewArchiveRule(ctx *Context, name string, args ArchiveRuleArgs, opts ...ResourceOption) (*ArchiveRule, error)
public ArchiveRule(string name, ArchiveRuleArgs args, CustomResourceOptions? opts = null)
public ArchiveRule(String name, ArchiveRuleArgs args)
public ArchiveRule(String name, ArchiveRuleArgs args, CustomResourceOptions options)
type: aws:accessanalyzer:ArchiveRule
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 ArchiveRuleArgs
- 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 ArchiveRuleArgs
- 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 ArchiveRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ArchiveRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ArchiveRuleArgs
- 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 archiveRuleResource = new Aws.AccessAnalyzer.ArchiveRule("archiveRuleResource", new()
{
AnalyzerName = "string",
Filters = new[]
{
new Aws.AccessAnalyzer.Inputs.ArchiveRuleFilterArgs
{
Criteria = "string",
Contains = new[]
{
"string",
},
Eqs = new[]
{
"string",
},
Exists = "string",
Neqs = new[]
{
"string",
},
},
},
RuleName = "string",
});
example, err := accessanalyzer.NewArchiveRule(ctx, "archiveRuleResource", &accessanalyzer.ArchiveRuleArgs{
AnalyzerName: pulumi.String("string"),
Filters: accessanalyzer.ArchiveRuleFilterArray{
&accessanalyzer.ArchiveRuleFilterArgs{
Criteria: pulumi.String("string"),
Contains: pulumi.StringArray{
pulumi.String("string"),
},
Eqs: pulumi.StringArray{
pulumi.String("string"),
},
Exists: pulumi.String("string"),
Neqs: pulumi.StringArray{
pulumi.String("string"),
},
},
},
RuleName: pulumi.String("string"),
})
var archiveRuleResource = new ArchiveRule("archiveRuleResource", ArchiveRuleArgs.builder()
.analyzerName("string")
.filters(ArchiveRuleFilterArgs.builder()
.criteria("string")
.contains("string")
.eqs("string")
.exists("string")
.neqs("string")
.build())
.ruleName("string")
.build());
archive_rule_resource = aws.accessanalyzer.ArchiveRule("archiveRuleResource",
analyzer_name="string",
filters=[{
"criteria": "string",
"contains": ["string"],
"eqs": ["string"],
"exists": "string",
"neqs": ["string"],
}],
rule_name="string")
const archiveRuleResource = new aws.accessanalyzer.ArchiveRule("archiveRuleResource", {
analyzerName: "string",
filters: [{
criteria: "string",
contains: ["string"],
eqs: ["string"],
exists: "string",
neqs: ["string"],
}],
ruleName: "string",
});
type: aws:accessanalyzer:ArchiveRule
properties:
analyzerName: string
filters:
- contains:
- string
criteria: string
eqs:
- string
exists: string
neqs:
- string
ruleName: string
ArchiveRule 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 ArchiveRule resource accepts the following input properties:
- Analyzer
Name string - Analyzer name.
- Filters
List<Archive
Rule Filter> - Filter criteria for the archive rule. See Filter for more details.
- Rule
Name string - Rule name.
- Analyzer
Name string - Analyzer name.
- Filters
[]Archive
Rule Filter Args - Filter criteria for the archive rule. See Filter for more details.
- Rule
Name string - Rule name.
- analyzer
Name String - Analyzer name.
- filters
List<Archive
Rule Filter> - Filter criteria for the archive rule. See Filter for more details.
- rule
Name String - Rule name.
- analyzer
Name string - Analyzer name.
- filters
Archive
Rule Filter[] - Filter criteria for the archive rule. See Filter for more details.
- rule
Name string - Rule name.
- analyzer_
name str - Analyzer name.
- filters
Sequence[Archive
Rule Filter Args] - Filter criteria for the archive rule. See Filter for more details.
- rule_
name str - Rule name.
- analyzer
Name String - Analyzer name.
- filters List<Property Map>
- Filter criteria for the archive rule. See Filter for more details.
- rule
Name String - Rule name.
Outputs
All input properties are implicitly available as output properties. Additionally, the ArchiveRule resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ArchiveRule Resource
Get an existing ArchiveRule 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?: ArchiveRuleState, opts?: CustomResourceOptions): ArchiveRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
analyzer_name: Optional[str] = None,
filters: Optional[Sequence[ArchiveRuleFilterArgs]] = None,
rule_name: Optional[str] = None) -> ArchiveRule
func GetArchiveRule(ctx *Context, name string, id IDInput, state *ArchiveRuleState, opts ...ResourceOption) (*ArchiveRule, error)
public static ArchiveRule Get(string name, Input<string> id, ArchiveRuleState? state, CustomResourceOptions? opts = null)
public static ArchiveRule get(String name, Output<String> id, ArchiveRuleState 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.
- Analyzer
Name string - Analyzer name.
- Filters
List<Archive
Rule Filter> - Filter criteria for the archive rule. See Filter for more details.
- Rule
Name string - Rule name.
- Analyzer
Name string - Analyzer name.
- Filters
[]Archive
Rule Filter Args - Filter criteria for the archive rule. See Filter for more details.
- Rule
Name string - Rule name.
- analyzer
Name String - Analyzer name.
- filters
List<Archive
Rule Filter> - Filter criteria for the archive rule. See Filter for more details.
- rule
Name String - Rule name.
- analyzer
Name string - Analyzer name.
- filters
Archive
Rule Filter[] - Filter criteria for the archive rule. See Filter for more details.
- rule
Name string - Rule name.
- analyzer_
name str - Analyzer name.
- filters
Sequence[Archive
Rule Filter Args] - Filter criteria for the archive rule. See Filter for more details.
- rule_
name str - Rule name.
- analyzer
Name String - Analyzer name.
- filters List<Property Map>
- Filter criteria for the archive rule. See Filter for more details.
- rule
Name String - Rule name.
Supporting Types
ArchiveRuleFilter, ArchiveRuleFilterArgs
Import
Using pulumi import
, import AccessAnalyzer ArchiveRule using the analyzer_name/rule_name
. For example:
$ pulumi import aws:accessanalyzer/archiveRule:ArchiveRule example example-analyzer/example-rule
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.