/
getLogGroup.go
147 lines (127 loc) · 9.12 KB
/
getLogGroup.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
// Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package logs
import (
"context"
"reflect"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The “AWS::Logs::LogGroup“ resource specifies a log group. A log group defines common properties for log streams, such as their retention and access control rules. Each log stream must belong to one log group.
//
// You can create up to 1,000,000 log groups per Region per account. You must use the following guidelines when naming a log group:
// + Log group names must be unique within a Region for an AWS account.
// + Log group names can be between 1 and 512 characters long.
// + Log group names consist of the following characters: a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), '/' (forward slash), and '.' (period).
func LookupLogGroup(ctx *pulumi.Context, args *LookupLogGroupArgs, opts ...pulumi.InvokeOption) (*LookupLogGroupResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupLogGroupResult
err := ctx.Invoke("aws-native:logs:getLogGroup", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupLogGroupArgs struct {
// The name of the log group. If you don't specify a name, CFNlong generates a unique ID for the log group.
LogGroupName string `pulumi:"logGroupName"`
}
type LookupLogGroupResult struct {
Arn *string `pulumi:"arn"`
// Creates a data protection policy and assigns it to the log group. A data protection policy can help safeguard sensitive data that's ingested by the log group by auditing and masking the sensitive log data. When a user who does not have permission to view masked data views a log event that includes masked data, the sensitive data is replaced by asterisks.
// For more information, including a list of types of data that can be audited and masked, see [Protect sensitive log data with masking](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html).
//
// Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::Logs::LogGroup` for more information about the expected schema for this property.
DataProtectionPolicy interface{} `pulumi:"dataProtectionPolicy"`
// The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data.
// To associate an KMS key with the log group, specify the ARN of that KMS key here. If you do so, ingested data is encrypted using this key. This association is stored as long as the data encrypted with the KMS key is still within CWL. This enables CWL to decrypt this data whenever it is requested.
// If you attempt to associate a KMS key with the log group but the KMS key doesn't exist or is deactivated, you will receive an ``InvalidParameterException`` error.
// Log group data is always encrypted in CWL. If you omit this key, the encryption does not use KMS. For more information, see [Encrypt log data in using](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html)
KmsKeyId *string `pulumi:"kmsKeyId"`
// Specifies the log group class for this log group. There are two classes:
// + The ``Standard`` log class supports all CWL features.
// + The ``Infrequent Access`` log class supports a subset of CWL features and incurs lower costs.
//
// For details about the features supported by each class, see [Log classes](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html)
LogGroupClass *LogGroupClass `pulumi:"logGroupClass"`
// The number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, and 3653.
// To set a log group so that its log events do not expire, use [DeleteRetentionPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteRetentionPolicy.html).
RetentionInDays *int `pulumi:"retentionInDays"`
// An array of key-value pairs to apply to the log group.
// For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).
Tags []aws.Tag `pulumi:"tags"`
}
func LookupLogGroupOutput(ctx *pulumi.Context, args LookupLogGroupOutputArgs, opts ...pulumi.InvokeOption) LookupLogGroupResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupLogGroupResult, error) {
args := v.(LookupLogGroupArgs)
r, err := LookupLogGroup(ctx, &args, opts...)
var s LookupLogGroupResult
if r != nil {
s = *r
}
return s, err
}).(LookupLogGroupResultOutput)
}
type LookupLogGroupOutputArgs struct {
// The name of the log group. If you don't specify a name, CFNlong generates a unique ID for the log group.
LogGroupName pulumi.StringInput `pulumi:"logGroupName"`
}
func (LookupLogGroupOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupLogGroupArgs)(nil)).Elem()
}
type LookupLogGroupResultOutput struct{ *pulumi.OutputState }
func (LookupLogGroupResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupLogGroupResult)(nil)).Elem()
}
func (o LookupLogGroupResultOutput) ToLookupLogGroupResultOutput() LookupLogGroupResultOutput {
return o
}
func (o LookupLogGroupResultOutput) ToLookupLogGroupResultOutputWithContext(ctx context.Context) LookupLogGroupResultOutput {
return o
}
func (o LookupLogGroupResultOutput) Arn() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupLogGroupResult) *string { return v.Arn }).(pulumi.StringPtrOutput)
}
// Creates a data protection policy and assigns it to the log group. A data protection policy can help safeguard sensitive data that's ingested by the log group by auditing and masking the sensitive log data. When a user who does not have permission to view masked data views a log event that includes masked data, the sensitive data is replaced by asterisks.
//
// For more information, including a list of types of data that can be audited and masked, see [Protect sensitive log data with masking](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html).
//
// Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::Logs::LogGroup` for more information about the expected schema for this property.
func (o LookupLogGroupResultOutput) DataProtectionPolicy() pulumi.AnyOutput {
return o.ApplyT(func(v LookupLogGroupResult) interface{} { return v.DataProtectionPolicy }).(pulumi.AnyOutput)
}
// The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data.
//
// To associate an KMS key with the log group, specify the ARN of that KMS key here. If you do so, ingested data is encrypted using this key. This association is stored as long as the data encrypted with the KMS key is still within CWL. This enables CWL to decrypt this data whenever it is requested.
// If you attempt to associate a KMS key with the log group but the KMS key doesn't exist or is deactivated, you will receive an ``InvalidParameterException`` error.
// Log group data is always encrypted in CWL. If you omit this key, the encryption does not use KMS. For more information, see [Encrypt log data in using](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html)
func (o LookupLogGroupResultOutput) KmsKeyId() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupLogGroupResult) *string { return v.KmsKeyId }).(pulumi.StringPtrOutput)
}
// Specifies the log group class for this log group. There are two classes:
//
// - The “Standard“ log class supports all CWL features.
//
// - The “Infrequent Access“ log class supports a subset of CWL features and incurs lower costs.
//
// For details about the features supported by each class, see [Log classes](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html)
func (o LookupLogGroupResultOutput) LogGroupClass() LogGroupClassPtrOutput {
return o.ApplyT(func(v LookupLogGroupResult) *LogGroupClass { return v.LogGroupClass }).(LogGroupClassPtrOutput)
}
// The number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, and 3653.
//
// To set a log group so that its log events do not expire, use [DeleteRetentionPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteRetentionPolicy.html).
func (o LookupLogGroupResultOutput) RetentionInDays() pulumi.IntPtrOutput {
return o.ApplyT(func(v LookupLogGroupResult) *int { return v.RetentionInDays }).(pulumi.IntPtrOutput)
}
// An array of key-value pairs to apply to the log group.
//
// For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).
func (o LookupLogGroupResultOutput) Tags() aws.TagArrayOutput {
return o.ApplyT(func(v LookupLogGroupResult) []aws.Tag { return v.Tags }).(aws.TagArrayOutput)
}
func init() {
pulumi.RegisterOutputType(LookupLogGroupResultOutput{})
}