@@ -43,10 +43,25 @@ func (l *APIGatewayDomainNameLister) List(ctx context.Context, o interface{}) ([
43
43
44
44
for i := range output .Items {
45
45
item := & output .Items [i ]
46
+
47
+ // Get tags for the domain
48
+ tagsOutput , err := svc .GetTags (ctx , & apigateway.GetTagsInput {
49
+ ResourceArn : aws .String ("arn:aws:apigateway:" + opts .Config .Region + "::/domainnames/" + * item .DomainName ),
50
+ })
51
+ if err != nil {
52
+ return nil , err
53
+ }
54
+
55
+ tags := make (map [string ]string )
56
+ for key , value := range tagsOutput .Tags {
57
+ tags [key ] = value
58
+ }
59
+
46
60
resources = append (resources , & APIGatewayDomainName {
47
61
svc : svc ,
48
62
DomainName : item .DomainName ,
49
63
DomainNameID : item .DomainNameId ,
64
+ Tags : tags ,
50
65
})
51
66
}
52
67
@@ -64,6 +79,7 @@ type APIGatewayDomainName struct {
64
79
svc * apigateway.Client
65
80
DomainName * string
66
81
DomainNameID * string
82
+ Tags map [string ]string
67
83
}
68
84
69
85
func (f * APIGatewayDomainName ) Remove (ctx context.Context ) error {
@@ -76,9 +92,20 @@ func (f *APIGatewayDomainName) Remove(ctx context.Context) error {
76
92
}
77
93
78
94
func (f * APIGatewayDomainName ) Properties () types.Properties {
79
- return types .NewPropertiesFromStruct (f )
95
+ properties := types .NewProperties ()
96
+
97
+ // Add all tags with "tag:" prefix
98
+ for key , value := range f .Tags {
99
+ properties .Set ("tag:" + key , value )
100
+ }
101
+
102
+ // Add other properties
103
+ properties .Set ("DomainName" , f .DomainName )
104
+ properties .Set ("DomainNameID" , f .DomainNameID )
105
+
106
+ return properties
80
107
}
81
108
82
109
func (f * APIGatewayDomainName ) String () string {
83
110
return * f .DomainName
84
- }
111
+ }
0 commit comments