@@ -13,7 +13,7 @@ import (
13
13
)
14
14
15
15
func NewAWSPlugin () schema.MachComposerPlugin {
16
- state := & AWSPlugin {
16
+ state := & Plugin {
17
17
provider : "3.74.1" ,
18
18
siteConfigs : map [string ]* SiteConfig {},
19
19
componentConfigs : map [string ]ComponentConfig {},
@@ -45,7 +45,7 @@ func NewAWSPlugin() schema.MachComposerPlugin {
45
45
})
46
46
}
47
47
48
- type AWSPlugin struct {
48
+ type Plugin struct {
49
49
environment string
50
50
provider string
51
51
remoteState * AWSTFState
@@ -54,28 +54,28 @@ type AWSPlugin struct {
54
54
endpointsConfigs map [string ]map [string ]EndpointConfig
55
55
}
56
56
57
- func (p * AWSPlugin ) Configure (environment string , provider string ) error {
57
+ func (p * Plugin ) Configure (environment string , provider string ) error {
58
58
p .environment = environment
59
59
if provider != "" {
60
60
p .provider = provider
61
61
}
62
62
return nil
63
63
}
64
64
65
- func (p * AWSPlugin ) IsEnabled () bool {
65
+ func (p * Plugin ) IsEnabled () bool {
66
66
return len (p .siteConfigs ) > 0
67
67
}
68
68
69
- func (p * AWSPlugin ) Identifier () string {
69
+ func (p * Plugin ) Identifier () string {
70
70
return "aws"
71
71
}
72
72
73
- func (p * AWSPlugin ) GetValidationSchema () (* schema.ValidationSchema , error ) {
73
+ func (p * Plugin ) GetValidationSchema () (* schema.ValidationSchema , error ) {
74
74
result := getSchema ()
75
75
return result , nil
76
76
}
77
77
78
- func (p * AWSPlugin ) SetRemoteStateBackend (data map [string ]any ) error {
78
+ func (p * Plugin ) SetRemoteStateBackend (data map [string ]any ) error {
79
79
state := & AWSTFState {}
80
80
if err := mapstructure .Decode (data , state ); err != nil {
81
81
return err
@@ -87,7 +87,7 @@ func (p *AWSPlugin) SetRemoteStateBackend(data map[string]any) error {
87
87
return nil
88
88
}
89
89
90
- func (p * AWSPlugin ) SetSiteConfig (site string , data map [string ]any ) error {
90
+ func (p * Plugin ) SetSiteConfig (site string , data map [string ]any ) error {
91
91
if len (data ) == 0 {
92
92
return nil
93
93
}
@@ -109,7 +109,7 @@ func (p *AWSPlugin) SetSiteConfig(site string, data map[string]any) error {
109
109
return nil
110
110
}
111
111
112
- func (p * AWSPlugin ) SetSiteEndpointsConfig (site string , data map [string ]any ) error {
112
+ func (p * Plugin ) SetSiteEndpointsConfig (site string , data map [string ]any ) error {
113
113
configs := map [string ]EndpointConfig {}
114
114
for epId , epData := range data {
115
115
cfg := EndpointConfig {}
@@ -142,7 +142,7 @@ func (p *AWSPlugin) SetSiteEndpointsConfig(site string, data map[string]any) err
142
142
return nil
143
143
}
144
144
145
- func (p * AWSPlugin ) SetComponentEndpointsConfig (component string , endpoints map [string ]string ) error {
145
+ func (p * Plugin ) SetComponentEndpointsConfig (component string , endpoints map [string ]string ) error {
146
146
cfg , ok := p .componentConfigs [component ]
147
147
if ! ok {
148
148
cfg = ComponentConfig {}
@@ -153,7 +153,7 @@ func (p *AWSPlugin) SetComponentEndpointsConfig(component string, endpoints map[
153
153
return nil
154
154
}
155
155
156
- func (p * AWSPlugin ) TerraformRenderStateBackend (site string ) (string , error ) {
156
+ func (p * Plugin ) TerraformRenderStateBackend (site string ) (string , error ) {
157
157
if p .remoteState == nil {
158
158
return "" , nil
159
159
}
@@ -183,7 +183,7 @@ func (p *AWSPlugin) TerraformRenderStateBackend(site string) (string, error) {
183
183
return helpers .RenderGoTemplate (template , templateContext )
184
184
}
185
185
186
- func (p * AWSPlugin ) TerraformRenderProviders (site string ) (string , error ) {
186
+ func (p * Plugin ) TerraformRenderProviders (site string ) (string , error ) {
187
187
cfg := p .getSiteConfig (site )
188
188
if cfg == nil {
189
189
return "" , nil
@@ -196,7 +196,7 @@ func (p *AWSPlugin) TerraformRenderProviders(site string) (string, error) {
196
196
return result , nil
197
197
}
198
198
199
- func (p * AWSPlugin ) TerraformRenderResources (site string ) (string , error ) {
199
+ func (p * Plugin ) TerraformRenderResources (site string ) (string , error ) {
200
200
cfg := p .getSiteConfig (site )
201
201
if cfg == nil {
202
202
return "" , nil
@@ -237,7 +237,7 @@ func (p *AWSPlugin) TerraformRenderResources(site string) (string, error) {
237
237
return content , nil
238
238
}
239
239
240
- func (p * AWSPlugin ) RenderTerraformComponent (site string , component string ) (* schema.ComponentSchema , error ) {
240
+ func (p * Plugin ) RenderTerraformComponent (site string , component string ) (* schema.ComponentSchema , error ) {
241
241
cfg := p .getSiteConfig (site )
242
242
if cfg == nil {
243
243
return nil , nil
@@ -257,7 +257,7 @@ func (p *AWSPlugin) RenderTerraformComponent(site string, component string) (*sc
257
257
return result , nil
258
258
}
259
259
260
- func (p * AWSPlugin ) getSiteConfig (site string ) * SiteConfig {
260
+ func (p * Plugin ) getSiteConfig (site string ) * SiteConfig {
261
261
cfg , ok := p .siteConfigs [site ]
262
262
if ! ok {
263
263
return nil
0 commit comments