github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/codebuild/reportGroup.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 codebuild
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Provides a CodeBuild Report Groups Resource.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"fmt"
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
    28  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/codebuild"
    29  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
    30  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/kms"
    31  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
    32  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    33  //
    34  // )
    35  //
    36  //	func main() {
    37  //		pulumi.Run(func(ctx *pulumi.Context) error {
    38  //			current, err := aws.GetCallerIdentity(ctx, nil, nil)
    39  //			if err != nil {
    40  //				return err
    41  //			}
    42  //			example, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
    43  //				Statements: []iam.GetPolicyDocumentStatement{
    44  //					{
    45  //						Sid:    pulumi.StringRef("Enable IAM User Permissions"),
    46  //						Effect: pulumi.StringRef("Allow"),
    47  //						Principals: []iam.GetPolicyDocumentStatementPrincipal{
    48  //							{
    49  //								Type: "AWS",
    50  //								Identifiers: []string{
    51  //									fmt.Sprintf("arn:aws:iam::%v:root", current.AccountId),
    52  //								},
    53  //							},
    54  //						},
    55  //						Actions: []string{
    56  //							"kms:*",
    57  //						},
    58  //						Resources: []string{
    59  //							"*",
    60  //						},
    61  //					},
    62  //				},
    63  //			}, nil)
    64  //			if err != nil {
    65  //				return err
    66  //			}
    67  //			exampleKey, err := kms.NewKey(ctx, "example", &kms.KeyArgs{
    68  //				Description:          pulumi.String("my test kms key"),
    69  //				DeletionWindowInDays: pulumi.Int(7),
    70  //				Policy:               pulumi.String(example.Json),
    71  //			})
    72  //			if err != nil {
    73  //				return err
    74  //			}
    75  //			exampleBucketV2, err := s3.NewBucketV2(ctx, "example", &s3.BucketV2Args{
    76  //				Bucket: pulumi.String("my-test"),
    77  //			})
    78  //			if err != nil {
    79  //				return err
    80  //			}
    81  //			_, err = codebuild.NewReportGroup(ctx, "example", &codebuild.ReportGroupArgs{
    82  //				Name: pulumi.String("my test report group"),
    83  //				Type: pulumi.String("TEST"),
    84  //				ExportConfig: &codebuild.ReportGroupExportConfigArgs{
    85  //					Type: pulumi.String("S3"),
    86  //					S3Destination: &codebuild.ReportGroupExportConfigS3DestinationArgs{
    87  //						Bucket:             exampleBucketV2.ID(),
    88  //						EncryptionDisabled: pulumi.Bool(false),
    89  //						EncryptionKey:      exampleKey.Arn,
    90  //						Packaging:          pulumi.String("NONE"),
    91  //						Path:               pulumi.String("/some"),
    92  //					},
    93  //				},
    94  //			})
    95  //			if err != nil {
    96  //				return err
    97  //			}
    98  //			return nil
    99  //		})
   100  //	}
   101  //
   102  // ```
   103  // <!--End PulumiCodeChooser -->
   104  //
   105  // ## Import
   106  //
   107  // Using `pulumi import`, import CodeBuild Report Group using the CodeBuild Report Group arn. For example:
   108  //
   109  // ```sh
   110  // $ pulumi import aws:codebuild/reportGroup:ReportGroup example arn:aws:codebuild:us-west-2:123456789:report-group/report-group-name
   111  // ```
   112  type ReportGroup struct {
   113  	pulumi.CustomResourceState
   114  
   115  	// The ARN of Report Group.
   116  	Arn pulumi.StringOutput `pulumi:"arn"`
   117  	// The date and time this Report Group was created.
   118  	Created pulumi.StringOutput `pulumi:"created"`
   119  	// If `true`, deletes any reports that belong to a report group before deleting the report group. If `false`, you must delete any reports in the report group before deleting it. Default value is `false`.
   120  	DeleteReports pulumi.BoolPtrOutput `pulumi:"deleteReports"`
   121  	// Information about the destination where the raw data of this Report Group is exported. see Export Config documented below.
   122  	ExportConfig ReportGroupExportConfigOutput `pulumi:"exportConfig"`
   123  	// The name of a Report Group.
   124  	Name pulumi.StringOutput `pulumi:"name"`
   125  	// Key-value mapping of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   126  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   127  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   128  	//
   129  	// Deprecated: Please use `tags` instead.
   130  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   131  	// The type of the Report Group. Valid value are `TEST` and `CODE_COVERAGE`.
   132  	Type pulumi.StringOutput `pulumi:"type"`
   133  }
   134  
   135  // NewReportGroup registers a new resource with the given unique name, arguments, and options.
   136  func NewReportGroup(ctx *pulumi.Context,
   137  	name string, args *ReportGroupArgs, opts ...pulumi.ResourceOption) (*ReportGroup, error) {
   138  	if args == nil {
   139  		return nil, errors.New("missing one or more required arguments")
   140  	}
   141  
   142  	if args.ExportConfig == nil {
   143  		return nil, errors.New("invalid value for required argument 'ExportConfig'")
   144  	}
   145  	if args.Type == nil {
   146  		return nil, errors.New("invalid value for required argument 'Type'")
   147  	}
   148  	opts = internal.PkgResourceDefaultOpts(opts)
   149  	var resource ReportGroup
   150  	err := ctx.RegisterResource("aws:codebuild/reportGroup:ReportGroup", name, args, &resource, opts...)
   151  	if err != nil {
   152  		return nil, err
   153  	}
   154  	return &resource, nil
   155  }
   156  
   157  // GetReportGroup gets an existing ReportGroup resource's state with the given name, ID, and optional
   158  // state properties that are used to uniquely qualify the lookup (nil if not required).
   159  func GetReportGroup(ctx *pulumi.Context,
   160  	name string, id pulumi.IDInput, state *ReportGroupState, opts ...pulumi.ResourceOption) (*ReportGroup, error) {
   161  	var resource ReportGroup
   162  	err := ctx.ReadResource("aws:codebuild/reportGroup:ReportGroup", name, id, state, &resource, opts...)
   163  	if err != nil {
   164  		return nil, err
   165  	}
   166  	return &resource, nil
   167  }
   168  
   169  // Input properties used for looking up and filtering ReportGroup resources.
   170  type reportGroupState struct {
   171  	// The ARN of Report Group.
   172  	Arn *string `pulumi:"arn"`
   173  	// The date and time this Report Group was created.
   174  	Created *string `pulumi:"created"`
   175  	// If `true`, deletes any reports that belong to a report group before deleting the report group. If `false`, you must delete any reports in the report group before deleting it. Default value is `false`.
   176  	DeleteReports *bool `pulumi:"deleteReports"`
   177  	// Information about the destination where the raw data of this Report Group is exported. see Export Config documented below.
   178  	ExportConfig *ReportGroupExportConfig `pulumi:"exportConfig"`
   179  	// The name of a Report Group.
   180  	Name *string `pulumi:"name"`
   181  	// Key-value mapping of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   182  	Tags map[string]string `pulumi:"tags"`
   183  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   184  	//
   185  	// Deprecated: Please use `tags` instead.
   186  	TagsAll map[string]string `pulumi:"tagsAll"`
   187  	// The type of the Report Group. Valid value are `TEST` and `CODE_COVERAGE`.
   188  	Type *string `pulumi:"type"`
   189  }
   190  
   191  type ReportGroupState struct {
   192  	// The ARN of Report Group.
   193  	Arn pulumi.StringPtrInput
   194  	// The date and time this Report Group was created.
   195  	Created pulumi.StringPtrInput
   196  	// If `true`, deletes any reports that belong to a report group before deleting the report group. If `false`, you must delete any reports in the report group before deleting it. Default value is `false`.
   197  	DeleteReports pulumi.BoolPtrInput
   198  	// Information about the destination where the raw data of this Report Group is exported. see Export Config documented below.
   199  	ExportConfig ReportGroupExportConfigPtrInput
   200  	// The name of a Report Group.
   201  	Name pulumi.StringPtrInput
   202  	// Key-value mapping of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   203  	Tags pulumi.StringMapInput
   204  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   205  	//
   206  	// Deprecated: Please use `tags` instead.
   207  	TagsAll pulumi.StringMapInput
   208  	// The type of the Report Group. Valid value are `TEST` and `CODE_COVERAGE`.
   209  	Type pulumi.StringPtrInput
   210  }
   211  
   212  func (ReportGroupState) ElementType() reflect.Type {
   213  	return reflect.TypeOf((*reportGroupState)(nil)).Elem()
   214  }
   215  
   216  type reportGroupArgs struct {
   217  	// If `true`, deletes any reports that belong to a report group before deleting the report group. If `false`, you must delete any reports in the report group before deleting it. Default value is `false`.
   218  	DeleteReports *bool `pulumi:"deleteReports"`
   219  	// Information about the destination where the raw data of this Report Group is exported. see Export Config documented below.
   220  	ExportConfig ReportGroupExportConfig `pulumi:"exportConfig"`
   221  	// The name of a Report Group.
   222  	Name *string `pulumi:"name"`
   223  	// Key-value mapping of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   224  	Tags map[string]string `pulumi:"tags"`
   225  	// The type of the Report Group. Valid value are `TEST` and `CODE_COVERAGE`.
   226  	Type string `pulumi:"type"`
   227  }
   228  
   229  // The set of arguments for constructing a ReportGroup resource.
   230  type ReportGroupArgs struct {
   231  	// If `true`, deletes any reports that belong to a report group before deleting the report group. If `false`, you must delete any reports in the report group before deleting it. Default value is `false`.
   232  	DeleteReports pulumi.BoolPtrInput
   233  	// Information about the destination where the raw data of this Report Group is exported. see Export Config documented below.
   234  	ExportConfig ReportGroupExportConfigInput
   235  	// The name of a Report Group.
   236  	Name pulumi.StringPtrInput
   237  	// Key-value mapping of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   238  	Tags pulumi.StringMapInput
   239  	// The type of the Report Group. Valid value are `TEST` and `CODE_COVERAGE`.
   240  	Type pulumi.StringInput
   241  }
   242  
   243  func (ReportGroupArgs) ElementType() reflect.Type {
   244  	return reflect.TypeOf((*reportGroupArgs)(nil)).Elem()
   245  }
   246  
   247  type ReportGroupInput interface {
   248  	pulumi.Input
   249  
   250  	ToReportGroupOutput() ReportGroupOutput
   251  	ToReportGroupOutputWithContext(ctx context.Context) ReportGroupOutput
   252  }
   253  
   254  func (*ReportGroup) ElementType() reflect.Type {
   255  	return reflect.TypeOf((**ReportGroup)(nil)).Elem()
   256  }
   257  
   258  func (i *ReportGroup) ToReportGroupOutput() ReportGroupOutput {
   259  	return i.ToReportGroupOutputWithContext(context.Background())
   260  }
   261  
   262  func (i *ReportGroup) ToReportGroupOutputWithContext(ctx context.Context) ReportGroupOutput {
   263  	return pulumi.ToOutputWithContext(ctx, i).(ReportGroupOutput)
   264  }
   265  
   266  // ReportGroupArrayInput is an input type that accepts ReportGroupArray and ReportGroupArrayOutput values.
   267  // You can construct a concrete instance of `ReportGroupArrayInput` via:
   268  //
   269  //	ReportGroupArray{ ReportGroupArgs{...} }
   270  type ReportGroupArrayInput interface {
   271  	pulumi.Input
   272  
   273  	ToReportGroupArrayOutput() ReportGroupArrayOutput
   274  	ToReportGroupArrayOutputWithContext(context.Context) ReportGroupArrayOutput
   275  }
   276  
   277  type ReportGroupArray []ReportGroupInput
   278  
   279  func (ReportGroupArray) ElementType() reflect.Type {
   280  	return reflect.TypeOf((*[]*ReportGroup)(nil)).Elem()
   281  }
   282  
   283  func (i ReportGroupArray) ToReportGroupArrayOutput() ReportGroupArrayOutput {
   284  	return i.ToReportGroupArrayOutputWithContext(context.Background())
   285  }
   286  
   287  func (i ReportGroupArray) ToReportGroupArrayOutputWithContext(ctx context.Context) ReportGroupArrayOutput {
   288  	return pulumi.ToOutputWithContext(ctx, i).(ReportGroupArrayOutput)
   289  }
   290  
   291  // ReportGroupMapInput is an input type that accepts ReportGroupMap and ReportGroupMapOutput values.
   292  // You can construct a concrete instance of `ReportGroupMapInput` via:
   293  //
   294  //	ReportGroupMap{ "key": ReportGroupArgs{...} }
   295  type ReportGroupMapInput interface {
   296  	pulumi.Input
   297  
   298  	ToReportGroupMapOutput() ReportGroupMapOutput
   299  	ToReportGroupMapOutputWithContext(context.Context) ReportGroupMapOutput
   300  }
   301  
   302  type ReportGroupMap map[string]ReportGroupInput
   303  
   304  func (ReportGroupMap) ElementType() reflect.Type {
   305  	return reflect.TypeOf((*map[string]*ReportGroup)(nil)).Elem()
   306  }
   307  
   308  func (i ReportGroupMap) ToReportGroupMapOutput() ReportGroupMapOutput {
   309  	return i.ToReportGroupMapOutputWithContext(context.Background())
   310  }
   311  
   312  func (i ReportGroupMap) ToReportGroupMapOutputWithContext(ctx context.Context) ReportGroupMapOutput {
   313  	return pulumi.ToOutputWithContext(ctx, i).(ReportGroupMapOutput)
   314  }
   315  
   316  type ReportGroupOutput struct{ *pulumi.OutputState }
   317  
   318  func (ReportGroupOutput) ElementType() reflect.Type {
   319  	return reflect.TypeOf((**ReportGroup)(nil)).Elem()
   320  }
   321  
   322  func (o ReportGroupOutput) ToReportGroupOutput() ReportGroupOutput {
   323  	return o
   324  }
   325  
   326  func (o ReportGroupOutput) ToReportGroupOutputWithContext(ctx context.Context) ReportGroupOutput {
   327  	return o
   328  }
   329  
   330  // The ARN of Report Group.
   331  func (o ReportGroupOutput) Arn() pulumi.StringOutput {
   332  	return o.ApplyT(func(v *ReportGroup) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   333  }
   334  
   335  // The date and time this Report Group was created.
   336  func (o ReportGroupOutput) Created() pulumi.StringOutput {
   337  	return o.ApplyT(func(v *ReportGroup) pulumi.StringOutput { return v.Created }).(pulumi.StringOutput)
   338  }
   339  
   340  // If `true`, deletes any reports that belong to a report group before deleting the report group. If `false`, you must delete any reports in the report group before deleting it. Default value is `false`.
   341  func (o ReportGroupOutput) DeleteReports() pulumi.BoolPtrOutput {
   342  	return o.ApplyT(func(v *ReportGroup) pulumi.BoolPtrOutput { return v.DeleteReports }).(pulumi.BoolPtrOutput)
   343  }
   344  
   345  // Information about the destination where the raw data of this Report Group is exported. see Export Config documented below.
   346  func (o ReportGroupOutput) ExportConfig() ReportGroupExportConfigOutput {
   347  	return o.ApplyT(func(v *ReportGroup) ReportGroupExportConfigOutput { return v.ExportConfig }).(ReportGroupExportConfigOutput)
   348  }
   349  
   350  // The name of a Report Group.
   351  func (o ReportGroupOutput) Name() pulumi.StringOutput {
   352  	return o.ApplyT(func(v *ReportGroup) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   353  }
   354  
   355  // Key-value mapping of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   356  func (o ReportGroupOutput) Tags() pulumi.StringMapOutput {
   357  	return o.ApplyT(func(v *ReportGroup) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   358  }
   359  
   360  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   361  //
   362  // Deprecated: Please use `tags` instead.
   363  func (o ReportGroupOutput) TagsAll() pulumi.StringMapOutput {
   364  	return o.ApplyT(func(v *ReportGroup) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   365  }
   366  
   367  // The type of the Report Group. Valid value are `TEST` and `CODE_COVERAGE`.
   368  func (o ReportGroupOutput) Type() pulumi.StringOutput {
   369  	return o.ApplyT(func(v *ReportGroup) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
   370  }
   371  
   372  type ReportGroupArrayOutput struct{ *pulumi.OutputState }
   373  
   374  func (ReportGroupArrayOutput) ElementType() reflect.Type {
   375  	return reflect.TypeOf((*[]*ReportGroup)(nil)).Elem()
   376  }
   377  
   378  func (o ReportGroupArrayOutput) ToReportGroupArrayOutput() ReportGroupArrayOutput {
   379  	return o
   380  }
   381  
   382  func (o ReportGroupArrayOutput) ToReportGroupArrayOutputWithContext(ctx context.Context) ReportGroupArrayOutput {
   383  	return o
   384  }
   385  
   386  func (o ReportGroupArrayOutput) Index(i pulumi.IntInput) ReportGroupOutput {
   387  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ReportGroup {
   388  		return vs[0].([]*ReportGroup)[vs[1].(int)]
   389  	}).(ReportGroupOutput)
   390  }
   391  
   392  type ReportGroupMapOutput struct{ *pulumi.OutputState }
   393  
   394  func (ReportGroupMapOutput) ElementType() reflect.Type {
   395  	return reflect.TypeOf((*map[string]*ReportGroup)(nil)).Elem()
   396  }
   397  
   398  func (o ReportGroupMapOutput) ToReportGroupMapOutput() ReportGroupMapOutput {
   399  	return o
   400  }
   401  
   402  func (o ReportGroupMapOutput) ToReportGroupMapOutputWithContext(ctx context.Context) ReportGroupMapOutput {
   403  	return o
   404  }
   405  
   406  func (o ReportGroupMapOutput) MapIndex(k pulumi.StringInput) ReportGroupOutput {
   407  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ReportGroup {
   408  		return vs[0].(map[string]*ReportGroup)[vs[1].(string)]
   409  	}).(ReportGroupOutput)
   410  }
   411  
   412  func init() {
   413  	pulumi.RegisterInputType(reflect.TypeOf((*ReportGroupInput)(nil)).Elem(), &ReportGroup{})
   414  	pulumi.RegisterInputType(reflect.TypeOf((*ReportGroupArrayInput)(nil)).Elem(), ReportGroupArray{})
   415  	pulumi.RegisterInputType(reflect.TypeOf((*ReportGroupMapInput)(nil)).Elem(), ReportGroupMap{})
   416  	pulumi.RegisterOutputType(ReportGroupOutput{})
   417  	pulumi.RegisterOutputType(ReportGroupArrayOutput{})
   418  	pulumi.RegisterOutputType(ReportGroupMapOutput{})
   419  }