-
Notifications
You must be signed in to change notification settings - Fork 151
/
recorder.go
110 lines (97 loc) · 4.96 KB
/
recorder.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package cfg
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Provides an AWS Config Configuration Recorder. Please note that this resource **does not start** the created recorder automatically.
//
// > **Note:** _Starting_ the Configuration Recorder requires a [delivery channel](https://www.terraform.io/docs/providers/aws/r/config_delivery_channel.html) (while delivery channel creation requires Configuration Recorder). This is why [`cfg.RecorderStatus`](https://www.terraform.io/docs/providers/aws/r/config_configuration_recorder_status.html) is a separate resource.
type Recorder struct {
pulumi.CustomResourceState
// The name of the recorder. Defaults to `default`. Changing it recreates the resource.
Name pulumi.StringOutput `pulumi:"name"`
// Recording group - see below.
RecordingGroup RecorderRecordingGroupOutput `pulumi:"recordingGroup"`
// Amazon Resource Name (ARN) of the IAM role.
// used to make read or write requests to the delivery channel and to describe the AWS resources associated with the account.
// See [AWS Docs](http://docs.aws.amazon.com/config/latest/developerguide/iamrole-permissions.html) for more details.
RoleArn pulumi.StringOutput `pulumi:"roleArn"`
}
// NewRecorder registers a new resource with the given unique name, arguments, and options.
func NewRecorder(ctx *pulumi.Context,
name string, args *RecorderArgs, opts ...pulumi.ResourceOption) (*Recorder, error) {
if args == nil || args.RoleArn == nil {
return nil, errors.New("missing required argument 'RoleArn'")
}
if args == nil {
args = &RecorderArgs{}
}
var resource Recorder
err := ctx.RegisterResource("aws:cfg/recorder:Recorder", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRecorder gets an existing Recorder resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetRecorder(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RecorderState, opts ...pulumi.ResourceOption) (*Recorder, error) {
var resource Recorder
err := ctx.ReadResource("aws:cfg/recorder:Recorder", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Recorder resources.
type recorderState struct {
// The name of the recorder. Defaults to `default`. Changing it recreates the resource.
Name *string `pulumi:"name"`
// Recording group - see below.
RecordingGroup *RecorderRecordingGroup `pulumi:"recordingGroup"`
// Amazon Resource Name (ARN) of the IAM role.
// used to make read or write requests to the delivery channel and to describe the AWS resources associated with the account.
// See [AWS Docs](http://docs.aws.amazon.com/config/latest/developerguide/iamrole-permissions.html) for more details.
RoleArn *string `pulumi:"roleArn"`
}
type RecorderState struct {
// The name of the recorder. Defaults to `default`. Changing it recreates the resource.
Name pulumi.StringPtrInput
// Recording group - see below.
RecordingGroup RecorderRecordingGroupPtrInput
// Amazon Resource Name (ARN) of the IAM role.
// used to make read or write requests to the delivery channel and to describe the AWS resources associated with the account.
// See [AWS Docs](http://docs.aws.amazon.com/config/latest/developerguide/iamrole-permissions.html) for more details.
RoleArn pulumi.StringPtrInput
}
func (RecorderState) ElementType() reflect.Type {
return reflect.TypeOf((*recorderState)(nil)).Elem()
}
type recorderArgs struct {
// The name of the recorder. Defaults to `default`. Changing it recreates the resource.
Name *string `pulumi:"name"`
// Recording group - see below.
RecordingGroup *RecorderRecordingGroup `pulumi:"recordingGroup"`
// Amazon Resource Name (ARN) of the IAM role.
// used to make read or write requests to the delivery channel and to describe the AWS resources associated with the account.
// See [AWS Docs](http://docs.aws.amazon.com/config/latest/developerguide/iamrole-permissions.html) for more details.
RoleArn string `pulumi:"roleArn"`
}
// The set of arguments for constructing a Recorder resource.
type RecorderArgs struct {
// The name of the recorder. Defaults to `default`. Changing it recreates the resource.
Name pulumi.StringPtrInput
// Recording group - see below.
RecordingGroup RecorderRecordingGroupPtrInput
// Amazon Resource Name (ARN) of the IAM role.
// used to make read or write requests to the delivery channel and to describe the AWS resources associated with the account.
// See [AWS Docs](http://docs.aws.amazon.com/config/latest/developerguide/iamrole-permissions.html) for more details.
RoleArn pulumi.StringInput
}
func (RecorderArgs) ElementType() reflect.Type {
return reflect.TypeOf((*recorderArgs)(nil)).Elem()
}