github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/devopsguru/serviceIntegration.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 devopsguru
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // ## Example Usage
    15  //
    16  // ### Basic Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/devopsguru"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			_, err := devopsguru.NewServiceIntegration(ctx, "example", &devopsguru.ServiceIntegrationArgs{
    32  //				KmsServerSideEncryption: &devopsguru.ServiceIntegrationKmsServerSideEncryptionArgs{
    33  //					OptInStatus: pulumi.String("ENABLED"),
    34  //					Type:        pulumi.String("AWS_OWNED_KMS_KEY"),
    35  //				},
    36  //				LogsAnomalyDetection: &devopsguru.ServiceIntegrationLogsAnomalyDetectionArgs{
    37  //					OptInStatus: pulumi.String("ENABLED"),
    38  //				},
    39  //				OpsCenter: &devopsguru.ServiceIntegrationOpsCenterArgs{
    40  //					OptInStatus: pulumi.String("ENABLED"),
    41  //				},
    42  //			})
    43  //			if err != nil {
    44  //				return err
    45  //			}
    46  //			return nil
    47  //		})
    48  //	}
    49  //
    50  // ```
    51  // <!--End PulumiCodeChooser -->
    52  //
    53  // ### Customer Managed KMS Key
    54  //
    55  // <!--Start PulumiCodeChooser -->
    56  // ```go
    57  // package main
    58  //
    59  // import (
    60  //
    61  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/devopsguru"
    62  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/kms"
    63  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    64  //
    65  // )
    66  //
    67  //	func main() {
    68  //		pulumi.Run(func(ctx *pulumi.Context) error {
    69  //			_, err := kms.NewKey(ctx, "example", nil)
    70  //			if err != nil {
    71  //				return err
    72  //			}
    73  //			_, err = devopsguru.NewServiceIntegration(ctx, "example", &devopsguru.ServiceIntegrationArgs{
    74  //				KmsServerSideEncryption: &devopsguru.ServiceIntegrationKmsServerSideEncryptionArgs{
    75  //					KmsKeyId:    pulumi.Any(test.Arn),
    76  //					OptInStatus: pulumi.String("ENABLED"),
    77  //					Type:        pulumi.String("CUSTOMER_MANAGED_KEY"),
    78  //				},
    79  //				LogsAnomalyDetection: &devopsguru.ServiceIntegrationLogsAnomalyDetectionArgs{
    80  //					OptInStatus: pulumi.String("DISABLED"),
    81  //				},
    82  //				OpsCenter: &devopsguru.ServiceIntegrationOpsCenterArgs{
    83  //					OptInStatus: pulumi.String("DISABLED"),
    84  //				},
    85  //			})
    86  //			if err != nil {
    87  //				return err
    88  //			}
    89  //			return nil
    90  //		})
    91  //	}
    92  //
    93  // ```
    94  // <!--End PulumiCodeChooser -->
    95  //
    96  // ## Import
    97  //
    98  // Using `pulumi import`, import DevOps Guru Service Integration using the `id`. For example:
    99  //
   100  // ```sh
   101  // $ pulumi import aws:devopsguru/serviceIntegration:ServiceIntegration example us-east-1
   102  // ```
   103  type ServiceIntegration struct {
   104  	pulumi.CustomResourceState
   105  
   106  	// Information about whether DevOps Guru is configured to encrypt server-side data using KMS. See `kmsServerSideEncryption` below.
   107  	KmsServerSideEncryption ServiceIntegrationKmsServerSideEncryptionPtrOutput `pulumi:"kmsServerSideEncryption"`
   108  	// Information about whether DevOps Guru is configured to perform log anomaly detection on Amazon CloudWatch log groups. See `logsAnomalyDetection` below.
   109  	LogsAnomalyDetection ServiceIntegrationLogsAnomalyDetectionPtrOutput `pulumi:"logsAnomalyDetection"`
   110  	// Information about whether DevOps Guru is configured to create an OpsItem in AWS Systems Manager OpsCenter for each created insight. See `opsCenter` below.
   111  	OpsCenter ServiceIntegrationOpsCenterPtrOutput `pulumi:"opsCenter"`
   112  }
   113  
   114  // NewServiceIntegration registers a new resource with the given unique name, arguments, and options.
   115  func NewServiceIntegration(ctx *pulumi.Context,
   116  	name string, args *ServiceIntegrationArgs, opts ...pulumi.ResourceOption) (*ServiceIntegration, error) {
   117  	if args == nil {
   118  		args = &ServiceIntegrationArgs{}
   119  	}
   120  
   121  	opts = internal.PkgResourceDefaultOpts(opts)
   122  	var resource ServiceIntegration
   123  	err := ctx.RegisterResource("aws:devopsguru/serviceIntegration:ServiceIntegration", name, args, &resource, opts...)
   124  	if err != nil {
   125  		return nil, err
   126  	}
   127  	return &resource, nil
   128  }
   129  
   130  // GetServiceIntegration gets an existing ServiceIntegration resource's state with the given name, ID, and optional
   131  // state properties that are used to uniquely qualify the lookup (nil if not required).
   132  func GetServiceIntegration(ctx *pulumi.Context,
   133  	name string, id pulumi.IDInput, state *ServiceIntegrationState, opts ...pulumi.ResourceOption) (*ServiceIntegration, error) {
   134  	var resource ServiceIntegration
   135  	err := ctx.ReadResource("aws:devopsguru/serviceIntegration:ServiceIntegration", name, id, state, &resource, opts...)
   136  	if err != nil {
   137  		return nil, err
   138  	}
   139  	return &resource, nil
   140  }
   141  
   142  // Input properties used for looking up and filtering ServiceIntegration resources.
   143  type serviceIntegrationState struct {
   144  	// Information about whether DevOps Guru is configured to encrypt server-side data using KMS. See `kmsServerSideEncryption` below.
   145  	KmsServerSideEncryption *ServiceIntegrationKmsServerSideEncryption `pulumi:"kmsServerSideEncryption"`
   146  	// Information about whether DevOps Guru is configured to perform log anomaly detection on Amazon CloudWatch log groups. See `logsAnomalyDetection` below.
   147  	LogsAnomalyDetection *ServiceIntegrationLogsAnomalyDetection `pulumi:"logsAnomalyDetection"`
   148  	// Information about whether DevOps Guru is configured to create an OpsItem in AWS Systems Manager OpsCenter for each created insight. See `opsCenter` below.
   149  	OpsCenter *ServiceIntegrationOpsCenter `pulumi:"opsCenter"`
   150  }
   151  
   152  type ServiceIntegrationState struct {
   153  	// Information about whether DevOps Guru is configured to encrypt server-side data using KMS. See `kmsServerSideEncryption` below.
   154  	KmsServerSideEncryption ServiceIntegrationKmsServerSideEncryptionPtrInput
   155  	// Information about whether DevOps Guru is configured to perform log anomaly detection on Amazon CloudWatch log groups. See `logsAnomalyDetection` below.
   156  	LogsAnomalyDetection ServiceIntegrationLogsAnomalyDetectionPtrInput
   157  	// Information about whether DevOps Guru is configured to create an OpsItem in AWS Systems Manager OpsCenter for each created insight. See `opsCenter` below.
   158  	OpsCenter ServiceIntegrationOpsCenterPtrInput
   159  }
   160  
   161  func (ServiceIntegrationState) ElementType() reflect.Type {
   162  	return reflect.TypeOf((*serviceIntegrationState)(nil)).Elem()
   163  }
   164  
   165  type serviceIntegrationArgs struct {
   166  	// Information about whether DevOps Guru is configured to encrypt server-side data using KMS. See `kmsServerSideEncryption` below.
   167  	KmsServerSideEncryption *ServiceIntegrationKmsServerSideEncryption `pulumi:"kmsServerSideEncryption"`
   168  	// Information about whether DevOps Guru is configured to perform log anomaly detection on Amazon CloudWatch log groups. See `logsAnomalyDetection` below.
   169  	LogsAnomalyDetection *ServiceIntegrationLogsAnomalyDetection `pulumi:"logsAnomalyDetection"`
   170  	// Information about whether DevOps Guru is configured to create an OpsItem in AWS Systems Manager OpsCenter for each created insight. See `opsCenter` below.
   171  	OpsCenter *ServiceIntegrationOpsCenter `pulumi:"opsCenter"`
   172  }
   173  
   174  // The set of arguments for constructing a ServiceIntegration resource.
   175  type ServiceIntegrationArgs struct {
   176  	// Information about whether DevOps Guru is configured to encrypt server-side data using KMS. See `kmsServerSideEncryption` below.
   177  	KmsServerSideEncryption ServiceIntegrationKmsServerSideEncryptionPtrInput
   178  	// Information about whether DevOps Guru is configured to perform log anomaly detection on Amazon CloudWatch log groups. See `logsAnomalyDetection` below.
   179  	LogsAnomalyDetection ServiceIntegrationLogsAnomalyDetectionPtrInput
   180  	// Information about whether DevOps Guru is configured to create an OpsItem in AWS Systems Manager OpsCenter for each created insight. See `opsCenter` below.
   181  	OpsCenter ServiceIntegrationOpsCenterPtrInput
   182  }
   183  
   184  func (ServiceIntegrationArgs) ElementType() reflect.Type {
   185  	return reflect.TypeOf((*serviceIntegrationArgs)(nil)).Elem()
   186  }
   187  
   188  type ServiceIntegrationInput interface {
   189  	pulumi.Input
   190  
   191  	ToServiceIntegrationOutput() ServiceIntegrationOutput
   192  	ToServiceIntegrationOutputWithContext(ctx context.Context) ServiceIntegrationOutput
   193  }
   194  
   195  func (*ServiceIntegration) ElementType() reflect.Type {
   196  	return reflect.TypeOf((**ServiceIntegration)(nil)).Elem()
   197  }
   198  
   199  func (i *ServiceIntegration) ToServiceIntegrationOutput() ServiceIntegrationOutput {
   200  	return i.ToServiceIntegrationOutputWithContext(context.Background())
   201  }
   202  
   203  func (i *ServiceIntegration) ToServiceIntegrationOutputWithContext(ctx context.Context) ServiceIntegrationOutput {
   204  	return pulumi.ToOutputWithContext(ctx, i).(ServiceIntegrationOutput)
   205  }
   206  
   207  // ServiceIntegrationArrayInput is an input type that accepts ServiceIntegrationArray and ServiceIntegrationArrayOutput values.
   208  // You can construct a concrete instance of `ServiceIntegrationArrayInput` via:
   209  //
   210  //	ServiceIntegrationArray{ ServiceIntegrationArgs{...} }
   211  type ServiceIntegrationArrayInput interface {
   212  	pulumi.Input
   213  
   214  	ToServiceIntegrationArrayOutput() ServiceIntegrationArrayOutput
   215  	ToServiceIntegrationArrayOutputWithContext(context.Context) ServiceIntegrationArrayOutput
   216  }
   217  
   218  type ServiceIntegrationArray []ServiceIntegrationInput
   219  
   220  func (ServiceIntegrationArray) ElementType() reflect.Type {
   221  	return reflect.TypeOf((*[]*ServiceIntegration)(nil)).Elem()
   222  }
   223  
   224  func (i ServiceIntegrationArray) ToServiceIntegrationArrayOutput() ServiceIntegrationArrayOutput {
   225  	return i.ToServiceIntegrationArrayOutputWithContext(context.Background())
   226  }
   227  
   228  func (i ServiceIntegrationArray) ToServiceIntegrationArrayOutputWithContext(ctx context.Context) ServiceIntegrationArrayOutput {
   229  	return pulumi.ToOutputWithContext(ctx, i).(ServiceIntegrationArrayOutput)
   230  }
   231  
   232  // ServiceIntegrationMapInput is an input type that accepts ServiceIntegrationMap and ServiceIntegrationMapOutput values.
   233  // You can construct a concrete instance of `ServiceIntegrationMapInput` via:
   234  //
   235  //	ServiceIntegrationMap{ "key": ServiceIntegrationArgs{...} }
   236  type ServiceIntegrationMapInput interface {
   237  	pulumi.Input
   238  
   239  	ToServiceIntegrationMapOutput() ServiceIntegrationMapOutput
   240  	ToServiceIntegrationMapOutputWithContext(context.Context) ServiceIntegrationMapOutput
   241  }
   242  
   243  type ServiceIntegrationMap map[string]ServiceIntegrationInput
   244  
   245  func (ServiceIntegrationMap) ElementType() reflect.Type {
   246  	return reflect.TypeOf((*map[string]*ServiceIntegration)(nil)).Elem()
   247  }
   248  
   249  func (i ServiceIntegrationMap) ToServiceIntegrationMapOutput() ServiceIntegrationMapOutput {
   250  	return i.ToServiceIntegrationMapOutputWithContext(context.Background())
   251  }
   252  
   253  func (i ServiceIntegrationMap) ToServiceIntegrationMapOutputWithContext(ctx context.Context) ServiceIntegrationMapOutput {
   254  	return pulumi.ToOutputWithContext(ctx, i).(ServiceIntegrationMapOutput)
   255  }
   256  
   257  type ServiceIntegrationOutput struct{ *pulumi.OutputState }
   258  
   259  func (ServiceIntegrationOutput) ElementType() reflect.Type {
   260  	return reflect.TypeOf((**ServiceIntegration)(nil)).Elem()
   261  }
   262  
   263  func (o ServiceIntegrationOutput) ToServiceIntegrationOutput() ServiceIntegrationOutput {
   264  	return o
   265  }
   266  
   267  func (o ServiceIntegrationOutput) ToServiceIntegrationOutputWithContext(ctx context.Context) ServiceIntegrationOutput {
   268  	return o
   269  }
   270  
   271  // Information about whether DevOps Guru is configured to encrypt server-side data using KMS. See `kmsServerSideEncryption` below.
   272  func (o ServiceIntegrationOutput) KmsServerSideEncryption() ServiceIntegrationKmsServerSideEncryptionPtrOutput {
   273  	return o.ApplyT(func(v *ServiceIntegration) ServiceIntegrationKmsServerSideEncryptionPtrOutput {
   274  		return v.KmsServerSideEncryption
   275  	}).(ServiceIntegrationKmsServerSideEncryptionPtrOutput)
   276  }
   277  
   278  // Information about whether DevOps Guru is configured to perform log anomaly detection on Amazon CloudWatch log groups. See `logsAnomalyDetection` below.
   279  func (o ServiceIntegrationOutput) LogsAnomalyDetection() ServiceIntegrationLogsAnomalyDetectionPtrOutput {
   280  	return o.ApplyT(func(v *ServiceIntegration) ServiceIntegrationLogsAnomalyDetectionPtrOutput {
   281  		return v.LogsAnomalyDetection
   282  	}).(ServiceIntegrationLogsAnomalyDetectionPtrOutput)
   283  }
   284  
   285  // Information about whether DevOps Guru is configured to create an OpsItem in AWS Systems Manager OpsCenter for each created insight. See `opsCenter` below.
   286  func (o ServiceIntegrationOutput) OpsCenter() ServiceIntegrationOpsCenterPtrOutput {
   287  	return o.ApplyT(func(v *ServiceIntegration) ServiceIntegrationOpsCenterPtrOutput { return v.OpsCenter }).(ServiceIntegrationOpsCenterPtrOutput)
   288  }
   289  
   290  type ServiceIntegrationArrayOutput struct{ *pulumi.OutputState }
   291  
   292  func (ServiceIntegrationArrayOutput) ElementType() reflect.Type {
   293  	return reflect.TypeOf((*[]*ServiceIntegration)(nil)).Elem()
   294  }
   295  
   296  func (o ServiceIntegrationArrayOutput) ToServiceIntegrationArrayOutput() ServiceIntegrationArrayOutput {
   297  	return o
   298  }
   299  
   300  func (o ServiceIntegrationArrayOutput) ToServiceIntegrationArrayOutputWithContext(ctx context.Context) ServiceIntegrationArrayOutput {
   301  	return o
   302  }
   303  
   304  func (o ServiceIntegrationArrayOutput) Index(i pulumi.IntInput) ServiceIntegrationOutput {
   305  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ServiceIntegration {
   306  		return vs[0].([]*ServiceIntegration)[vs[1].(int)]
   307  	}).(ServiceIntegrationOutput)
   308  }
   309  
   310  type ServiceIntegrationMapOutput struct{ *pulumi.OutputState }
   311  
   312  func (ServiceIntegrationMapOutput) ElementType() reflect.Type {
   313  	return reflect.TypeOf((*map[string]*ServiceIntegration)(nil)).Elem()
   314  }
   315  
   316  func (o ServiceIntegrationMapOutput) ToServiceIntegrationMapOutput() ServiceIntegrationMapOutput {
   317  	return o
   318  }
   319  
   320  func (o ServiceIntegrationMapOutput) ToServiceIntegrationMapOutputWithContext(ctx context.Context) ServiceIntegrationMapOutput {
   321  	return o
   322  }
   323  
   324  func (o ServiceIntegrationMapOutput) MapIndex(k pulumi.StringInput) ServiceIntegrationOutput {
   325  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ServiceIntegration {
   326  		return vs[0].(map[string]*ServiceIntegration)[vs[1].(string)]
   327  	}).(ServiceIntegrationOutput)
   328  }
   329  
   330  func init() {
   331  	pulumi.RegisterInputType(reflect.TypeOf((*ServiceIntegrationInput)(nil)).Elem(), &ServiceIntegration{})
   332  	pulumi.RegisterInputType(reflect.TypeOf((*ServiceIntegrationArrayInput)(nil)).Elem(), ServiceIntegrationArray{})
   333  	pulumi.RegisterInputType(reflect.TypeOf((*ServiceIntegrationMapInput)(nil)).Elem(), ServiceIntegrationMap{})
   334  	pulumi.RegisterOutputType(ServiceIntegrationOutput{})
   335  	pulumi.RegisterOutputType(ServiceIntegrationArrayOutput{})
   336  	pulumi.RegisterOutputType(ServiceIntegrationMapOutput{})
   337  }