github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/emr/studioSessionMapping.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 emr 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 an Elastic MapReduce Studio Session Mapping. 16 // 17 // ## Example Usage 18 // 19 // <!--Start PulumiCodeChooser --> 20 // ```go 21 // package main 22 // 23 // import ( 24 // 25 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/emr" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // _, err := emr.NewStudioSessionMapping(ctx, "example", &emr.StudioSessionMappingArgs{ 33 // StudioId: pulumi.Any(exampleAwsEmrStudio.Id), 34 // IdentityType: pulumi.String("USER"), 35 // IdentityId: pulumi.String("example"), 36 // SessionPolicyArn: pulumi.Any(exampleAwsIamPolicy.Arn), 37 // }) 38 // if err != nil { 39 // return err 40 // } 41 // return nil 42 // }) 43 // } 44 // 45 // ``` 46 // <!--End PulumiCodeChooser --> 47 // 48 // ## Import 49 // 50 // Using `pulumi import`, import EMR studio session mappings using `studio-id:identity-type:identity-id`. For example: 51 // 52 // ```sh 53 // $ pulumi import aws:emr/studioSessionMapping:StudioSessionMapping example es-xxxxx:USER:xxxxx-xxx-xxx 54 // ``` 55 type StudioSessionMapping struct { 56 pulumi.CustomResourceState 57 58 // The globally unique identifier (GUID) of the user or group from the Amazon Web Services SSO Identity Store. 59 IdentityId pulumi.StringOutput `pulumi:"identityId"` 60 // The name of the user or group from the Amazon Web Services SSO Identity Store. 61 IdentityName pulumi.StringOutput `pulumi:"identityName"` 62 // Specifies whether the identity to map to the Amazon EMR Studio is a `USER` or a `GROUP`. 63 IdentityType pulumi.StringOutput `pulumi:"identityType"` 64 // The Amazon Resource Name (ARN) for the session policy that will be applied to the user or group. You should specify the ARN for the session policy that you want to apply, not the ARN of your user role. 65 SessionPolicyArn pulumi.StringOutput `pulumi:"sessionPolicyArn"` 66 // The ID of the Amazon EMR Studio to which the user or group will be mapped. 67 StudioId pulumi.StringOutput `pulumi:"studioId"` 68 } 69 70 // NewStudioSessionMapping registers a new resource with the given unique name, arguments, and options. 71 func NewStudioSessionMapping(ctx *pulumi.Context, 72 name string, args *StudioSessionMappingArgs, opts ...pulumi.ResourceOption) (*StudioSessionMapping, error) { 73 if args == nil { 74 return nil, errors.New("missing one or more required arguments") 75 } 76 77 if args.IdentityType == nil { 78 return nil, errors.New("invalid value for required argument 'IdentityType'") 79 } 80 if args.SessionPolicyArn == nil { 81 return nil, errors.New("invalid value for required argument 'SessionPolicyArn'") 82 } 83 if args.StudioId == nil { 84 return nil, errors.New("invalid value for required argument 'StudioId'") 85 } 86 opts = internal.PkgResourceDefaultOpts(opts) 87 var resource StudioSessionMapping 88 err := ctx.RegisterResource("aws:emr/studioSessionMapping:StudioSessionMapping", name, args, &resource, opts...) 89 if err != nil { 90 return nil, err 91 } 92 return &resource, nil 93 } 94 95 // GetStudioSessionMapping gets an existing StudioSessionMapping resource's state with the given name, ID, and optional 96 // state properties that are used to uniquely qualify the lookup (nil if not required). 97 func GetStudioSessionMapping(ctx *pulumi.Context, 98 name string, id pulumi.IDInput, state *StudioSessionMappingState, opts ...pulumi.ResourceOption) (*StudioSessionMapping, error) { 99 var resource StudioSessionMapping 100 err := ctx.ReadResource("aws:emr/studioSessionMapping:StudioSessionMapping", name, id, state, &resource, opts...) 101 if err != nil { 102 return nil, err 103 } 104 return &resource, nil 105 } 106 107 // Input properties used for looking up and filtering StudioSessionMapping resources. 108 type studioSessionMappingState struct { 109 // The globally unique identifier (GUID) of the user or group from the Amazon Web Services SSO Identity Store. 110 IdentityId *string `pulumi:"identityId"` 111 // The name of the user or group from the Amazon Web Services SSO Identity Store. 112 IdentityName *string `pulumi:"identityName"` 113 // Specifies whether the identity to map to the Amazon EMR Studio is a `USER` or a `GROUP`. 114 IdentityType *string `pulumi:"identityType"` 115 // The Amazon Resource Name (ARN) for the session policy that will be applied to the user or group. You should specify the ARN for the session policy that you want to apply, not the ARN of your user role. 116 SessionPolicyArn *string `pulumi:"sessionPolicyArn"` 117 // The ID of the Amazon EMR Studio to which the user or group will be mapped. 118 StudioId *string `pulumi:"studioId"` 119 } 120 121 type StudioSessionMappingState struct { 122 // The globally unique identifier (GUID) of the user or group from the Amazon Web Services SSO Identity Store. 123 IdentityId pulumi.StringPtrInput 124 // The name of the user or group from the Amazon Web Services SSO Identity Store. 125 IdentityName pulumi.StringPtrInput 126 // Specifies whether the identity to map to the Amazon EMR Studio is a `USER` or a `GROUP`. 127 IdentityType pulumi.StringPtrInput 128 // The Amazon Resource Name (ARN) for the session policy that will be applied to the user or group. You should specify the ARN for the session policy that you want to apply, not the ARN of your user role. 129 SessionPolicyArn pulumi.StringPtrInput 130 // The ID of the Amazon EMR Studio to which the user or group will be mapped. 131 StudioId pulumi.StringPtrInput 132 } 133 134 func (StudioSessionMappingState) ElementType() reflect.Type { 135 return reflect.TypeOf((*studioSessionMappingState)(nil)).Elem() 136 } 137 138 type studioSessionMappingArgs struct { 139 // The globally unique identifier (GUID) of the user or group from the Amazon Web Services SSO Identity Store. 140 IdentityId *string `pulumi:"identityId"` 141 // The name of the user or group from the Amazon Web Services SSO Identity Store. 142 IdentityName *string `pulumi:"identityName"` 143 // Specifies whether the identity to map to the Amazon EMR Studio is a `USER` or a `GROUP`. 144 IdentityType string `pulumi:"identityType"` 145 // The Amazon Resource Name (ARN) for the session policy that will be applied to the user or group. You should specify the ARN for the session policy that you want to apply, not the ARN of your user role. 146 SessionPolicyArn string `pulumi:"sessionPolicyArn"` 147 // The ID of the Amazon EMR Studio to which the user or group will be mapped. 148 StudioId string `pulumi:"studioId"` 149 } 150 151 // The set of arguments for constructing a StudioSessionMapping resource. 152 type StudioSessionMappingArgs struct { 153 // The globally unique identifier (GUID) of the user or group from the Amazon Web Services SSO Identity Store. 154 IdentityId pulumi.StringPtrInput 155 // The name of the user or group from the Amazon Web Services SSO Identity Store. 156 IdentityName pulumi.StringPtrInput 157 // Specifies whether the identity to map to the Amazon EMR Studio is a `USER` or a `GROUP`. 158 IdentityType pulumi.StringInput 159 // The Amazon Resource Name (ARN) for the session policy that will be applied to the user or group. You should specify the ARN for the session policy that you want to apply, not the ARN of your user role. 160 SessionPolicyArn pulumi.StringInput 161 // The ID of the Amazon EMR Studio to which the user or group will be mapped. 162 StudioId pulumi.StringInput 163 } 164 165 func (StudioSessionMappingArgs) ElementType() reflect.Type { 166 return reflect.TypeOf((*studioSessionMappingArgs)(nil)).Elem() 167 } 168 169 type StudioSessionMappingInput interface { 170 pulumi.Input 171 172 ToStudioSessionMappingOutput() StudioSessionMappingOutput 173 ToStudioSessionMappingOutputWithContext(ctx context.Context) StudioSessionMappingOutput 174 } 175 176 func (*StudioSessionMapping) ElementType() reflect.Type { 177 return reflect.TypeOf((**StudioSessionMapping)(nil)).Elem() 178 } 179 180 func (i *StudioSessionMapping) ToStudioSessionMappingOutput() StudioSessionMappingOutput { 181 return i.ToStudioSessionMappingOutputWithContext(context.Background()) 182 } 183 184 func (i *StudioSessionMapping) ToStudioSessionMappingOutputWithContext(ctx context.Context) StudioSessionMappingOutput { 185 return pulumi.ToOutputWithContext(ctx, i).(StudioSessionMappingOutput) 186 } 187 188 // StudioSessionMappingArrayInput is an input type that accepts StudioSessionMappingArray and StudioSessionMappingArrayOutput values. 189 // You can construct a concrete instance of `StudioSessionMappingArrayInput` via: 190 // 191 // StudioSessionMappingArray{ StudioSessionMappingArgs{...} } 192 type StudioSessionMappingArrayInput interface { 193 pulumi.Input 194 195 ToStudioSessionMappingArrayOutput() StudioSessionMappingArrayOutput 196 ToStudioSessionMappingArrayOutputWithContext(context.Context) StudioSessionMappingArrayOutput 197 } 198 199 type StudioSessionMappingArray []StudioSessionMappingInput 200 201 func (StudioSessionMappingArray) ElementType() reflect.Type { 202 return reflect.TypeOf((*[]*StudioSessionMapping)(nil)).Elem() 203 } 204 205 func (i StudioSessionMappingArray) ToStudioSessionMappingArrayOutput() StudioSessionMappingArrayOutput { 206 return i.ToStudioSessionMappingArrayOutputWithContext(context.Background()) 207 } 208 209 func (i StudioSessionMappingArray) ToStudioSessionMappingArrayOutputWithContext(ctx context.Context) StudioSessionMappingArrayOutput { 210 return pulumi.ToOutputWithContext(ctx, i).(StudioSessionMappingArrayOutput) 211 } 212 213 // StudioSessionMappingMapInput is an input type that accepts StudioSessionMappingMap and StudioSessionMappingMapOutput values. 214 // You can construct a concrete instance of `StudioSessionMappingMapInput` via: 215 // 216 // StudioSessionMappingMap{ "key": StudioSessionMappingArgs{...} } 217 type StudioSessionMappingMapInput interface { 218 pulumi.Input 219 220 ToStudioSessionMappingMapOutput() StudioSessionMappingMapOutput 221 ToStudioSessionMappingMapOutputWithContext(context.Context) StudioSessionMappingMapOutput 222 } 223 224 type StudioSessionMappingMap map[string]StudioSessionMappingInput 225 226 func (StudioSessionMappingMap) ElementType() reflect.Type { 227 return reflect.TypeOf((*map[string]*StudioSessionMapping)(nil)).Elem() 228 } 229 230 func (i StudioSessionMappingMap) ToStudioSessionMappingMapOutput() StudioSessionMappingMapOutput { 231 return i.ToStudioSessionMappingMapOutputWithContext(context.Background()) 232 } 233 234 func (i StudioSessionMappingMap) ToStudioSessionMappingMapOutputWithContext(ctx context.Context) StudioSessionMappingMapOutput { 235 return pulumi.ToOutputWithContext(ctx, i).(StudioSessionMappingMapOutput) 236 } 237 238 type StudioSessionMappingOutput struct{ *pulumi.OutputState } 239 240 func (StudioSessionMappingOutput) ElementType() reflect.Type { 241 return reflect.TypeOf((**StudioSessionMapping)(nil)).Elem() 242 } 243 244 func (o StudioSessionMappingOutput) ToStudioSessionMappingOutput() StudioSessionMappingOutput { 245 return o 246 } 247 248 func (o StudioSessionMappingOutput) ToStudioSessionMappingOutputWithContext(ctx context.Context) StudioSessionMappingOutput { 249 return o 250 } 251 252 // The globally unique identifier (GUID) of the user or group from the Amazon Web Services SSO Identity Store. 253 func (o StudioSessionMappingOutput) IdentityId() pulumi.StringOutput { 254 return o.ApplyT(func(v *StudioSessionMapping) pulumi.StringOutput { return v.IdentityId }).(pulumi.StringOutput) 255 } 256 257 // The name of the user or group from the Amazon Web Services SSO Identity Store. 258 func (o StudioSessionMappingOutput) IdentityName() pulumi.StringOutput { 259 return o.ApplyT(func(v *StudioSessionMapping) pulumi.StringOutput { return v.IdentityName }).(pulumi.StringOutput) 260 } 261 262 // Specifies whether the identity to map to the Amazon EMR Studio is a `USER` or a `GROUP`. 263 func (o StudioSessionMappingOutput) IdentityType() pulumi.StringOutput { 264 return o.ApplyT(func(v *StudioSessionMapping) pulumi.StringOutput { return v.IdentityType }).(pulumi.StringOutput) 265 } 266 267 // The Amazon Resource Name (ARN) for the session policy that will be applied to the user or group. You should specify the ARN for the session policy that you want to apply, not the ARN of your user role. 268 func (o StudioSessionMappingOutput) SessionPolicyArn() pulumi.StringOutput { 269 return o.ApplyT(func(v *StudioSessionMapping) pulumi.StringOutput { return v.SessionPolicyArn }).(pulumi.StringOutput) 270 } 271 272 // The ID of the Amazon EMR Studio to which the user or group will be mapped. 273 func (o StudioSessionMappingOutput) StudioId() pulumi.StringOutput { 274 return o.ApplyT(func(v *StudioSessionMapping) pulumi.StringOutput { return v.StudioId }).(pulumi.StringOutput) 275 } 276 277 type StudioSessionMappingArrayOutput struct{ *pulumi.OutputState } 278 279 func (StudioSessionMappingArrayOutput) ElementType() reflect.Type { 280 return reflect.TypeOf((*[]*StudioSessionMapping)(nil)).Elem() 281 } 282 283 func (o StudioSessionMappingArrayOutput) ToStudioSessionMappingArrayOutput() StudioSessionMappingArrayOutput { 284 return o 285 } 286 287 func (o StudioSessionMappingArrayOutput) ToStudioSessionMappingArrayOutputWithContext(ctx context.Context) StudioSessionMappingArrayOutput { 288 return o 289 } 290 291 func (o StudioSessionMappingArrayOutput) Index(i pulumi.IntInput) StudioSessionMappingOutput { 292 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *StudioSessionMapping { 293 return vs[0].([]*StudioSessionMapping)[vs[1].(int)] 294 }).(StudioSessionMappingOutput) 295 } 296 297 type StudioSessionMappingMapOutput struct{ *pulumi.OutputState } 298 299 func (StudioSessionMappingMapOutput) ElementType() reflect.Type { 300 return reflect.TypeOf((*map[string]*StudioSessionMapping)(nil)).Elem() 301 } 302 303 func (o StudioSessionMappingMapOutput) ToStudioSessionMappingMapOutput() StudioSessionMappingMapOutput { 304 return o 305 } 306 307 func (o StudioSessionMappingMapOutput) ToStudioSessionMappingMapOutputWithContext(ctx context.Context) StudioSessionMappingMapOutput { 308 return o 309 } 310 311 func (o StudioSessionMappingMapOutput) MapIndex(k pulumi.StringInput) StudioSessionMappingOutput { 312 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *StudioSessionMapping { 313 return vs[0].(map[string]*StudioSessionMapping)[vs[1].(string)] 314 }).(StudioSessionMappingOutput) 315 } 316 317 func init() { 318 pulumi.RegisterInputType(reflect.TypeOf((*StudioSessionMappingInput)(nil)).Elem(), &StudioSessionMapping{}) 319 pulumi.RegisterInputType(reflect.TypeOf((*StudioSessionMappingArrayInput)(nil)).Elem(), StudioSessionMappingArray{}) 320 pulumi.RegisterInputType(reflect.TypeOf((*StudioSessionMappingMapInput)(nil)).Elem(), StudioSessionMappingMap{}) 321 pulumi.RegisterOutputType(StudioSessionMappingOutput{}) 322 pulumi.RegisterOutputType(StudioSessionMappingArrayOutput{}) 323 pulumi.RegisterOutputType(StudioSessionMappingMapOutput{}) 324 }