8
8
"log"
9
9
10
10
"github.com/aws/aws-sdk-go-v2/aws"
11
+ "github.com/aws/aws-sdk-go-v2/aws/arn"
11
12
"github.com/aws/aws-sdk-go-v2/service/codedeploy"
12
13
"github.com/aws/aws-sdk-go-v2/service/codedeploy/types"
13
14
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
@@ -32,6 +33,10 @@ func resourceDeploymentConfig() *schema.Resource {
32
33
},
33
34
34
35
Schema : map [string ]* schema.Schema {
36
+ "arn" : {
37
+ Type : schema .TypeString ,
38
+ Computed : true ,
39
+ },
35
40
"compute_platform" : {
36
41
Type : schema .TypeString ,
37
42
Optional : true ,
@@ -171,9 +176,18 @@ func resourceDeploymentConfigRead(ctx context.Context, d *schema.ResourceData, m
171
176
return sdkdiag .AppendErrorf (diags , "reading CodeDeploy Deployment Config (%s): %s" , d .Id (), err )
172
177
}
173
178
179
+ deploymentConfigName := aws .ToString (deploymentConfig .DeploymentConfigName )
180
+ arn := arn.ARN {
181
+ Partition : meta .(* conns.AWSClient ).Partition ,
182
+ Service : "codedeploy" ,
183
+ Region : meta .(* conns.AWSClient ).Region ,
184
+ AccountID : meta .(* conns.AWSClient ).AccountID ,
185
+ Resource : "deploymentconfig:" + deploymentConfigName ,
186
+ }.String ()
187
+ d .Set ("arn" , arn )
174
188
d .Set ("compute_platform" , deploymentConfig .ComputePlatform )
175
189
d .Set ("deployment_config_id" , deploymentConfig .DeploymentConfigId )
176
- d .Set ("deployment_config_name" , deploymentConfig . DeploymentConfigName )
190
+ d .Set ("deployment_config_name" , deploymentConfigName )
177
191
if err := d .Set ("minimum_healthy_hosts" , flattenMinimumHealthHosts (deploymentConfig .MinimumHealthyHosts )); err != nil {
178
192
return sdkdiag .AppendErrorf (diags , "setting minimum_healthy_hosts: %s" , err )
179
193
}
0 commit comments