@@ -10,6 +10,8 @@ import (
1010type awsSignatureAuthenticationMethodModel struct {
1111 AccessKeyID types.String `tfsdk:"access_key_id"`
1212 SecretAccessKey types.String `tfsdk:"secret_access_key"`
13+ Region types.String `tfsdk:"region"`
14+ Service types.String `tfsdk:"service"`
1315}
1416
1517type awsSignatureAuthenticationMethod struct {
@@ -33,6 +35,16 @@ func (*awsSignatureAuthenticationMethod) schema() schema.Attribute {
3335 Sensitive : true ,
3436 Description : `AWS secret access key` ,
3537 },
38+ "region" : schema.StringAttribute {
39+ Optional : true ,
40+ Sensitive : false ,
41+ Description : `AWS region` ,
42+ },
43+ "service" : schema.StringAttribute {
44+ Optional : true ,
45+ Sensitive : false ,
46+ Description : `AWS service` ,
47+ },
3648 },
3749 Description : `AWS Signature` ,
3850 }
@@ -42,6 +54,8 @@ func awsSignatureAuthenticationMethodAttrTypesMap() map[string]attr.Type {
4254 return map [string ]attr.Type {
4355 "access_key_id" : types .StringType ,
4456 "secret_access_key" : types .StringType ,
57+ "region" : types .StringType ,
58+ "service" : types .StringType ,
4559 }
4660}
4761
@@ -61,6 +75,12 @@ func (awsSignatureAuthenticationMethod) refresh(m *destinationResourceModel, des
6175 m .AuthMethod .AWSSignature = & awsSignatureAuthenticationMethodModel {}
6276 m .AuthMethod .AWSSignature .AccessKeyID = types .StringValue (destination .AuthMethod .AwsSignature .Config .AccessKeyId )
6377 m .AuthMethod .AWSSignature .SecretAccessKey = types .StringValue (destination .AuthMethod .AwsSignature .Config .SecretAccessKey )
78+ if destination .AuthMethod .AwsSignature .Config .Region != nil {
79+ m .AuthMethod .AWSSignature .Region = types .StringValue (* destination .AuthMethod .AwsSignature .Config .Region )
80+ }
81+ if destination .AuthMethod .AwsSignature .Config .Service != nil {
82+ m .AuthMethod .AWSSignature .Service = types .StringValue (* destination .AuthMethod .AwsSignature .Config .Service )
83+ }
6484}
6585
6686func (awsSignatureAuthenticationMethod ) toPayload (method * destinationAuthMethodConfig ) * hookdeck.DestinationAuthMethodConfig {
@@ -72,6 +92,8 @@ func (awsSignatureAuthenticationMethod) toPayload(method *destinationAuthMethodC
7292 Config : & hookdeck.DestinationAuthMethodAwsSignatureConfig {
7393 AccessKeyId : method .AWSSignature .AccessKeyID .ValueString (),
7494 SecretAccessKey : method .AWSSignature .SecretAccessKey .ValueString (),
95+ Region : method .AWSSignature .Region .ValueStringPointer (),
96+ Service : method .AWSSignature .Service .ValueStringPointer (),
7597 },
7698 })
7799}
0 commit comments