@@ -20,7 +20,7 @@ func resourceMachine() *schema.Resource {
2020 ReadContext : resourceMachineRead ,
2121 UpdateContext : resourceMachineUpdate ,
2222 Schema : map [string ]* schema.Schema {
23- "driver " : & schema.Schema {
23+ "cloud " : & schema.Schema {
2424 Type : schema .TypeString ,
2525 Required : true ,
2626 ForceNew : true ,
@@ -31,7 +31,7 @@ func resourceMachine() *schema.Resource {
3131 ForceNew : true ,
3232 Default : "us-west" ,
3333 },
34- "ami " : & schema.Schema {
34+ "image " : & schema.Schema {
3535 Type : schema .TypeString ,
3636 Optional : true ,
3737 ForceNew : true ,
@@ -61,7 +61,6 @@ func resourceMachine() *schema.Resource {
6161 ForceNew : true ,
6262 Default : "" ,
6363 },
64-
6564 "instance_id" : & schema.Schema {
6665 Type : schema .TypeString ,
6766 Optional : true ,
@@ -89,12 +88,12 @@ func resourceMachine() *schema.Resource {
8988 Optional : true ,
9089 Computed : true ,
9190 },
91+
9292 "key_name" : & schema.Schema {
9393 Type : schema .TypeString ,
9494 Optional : true ,
9595 Computed : true ,
9696 },
97-
9897 "aws_security_group" : & schema.Schema {
9998 Type : schema .TypeString ,
10099 Optional : true ,
@@ -109,7 +108,6 @@ func resourceMachineCreate(ctx context.Context, d *schema.ResourceData, m interf
109108 var diags diag.Diagnostics
110109
111110 keyPublic := d .Get ("key_public" ).(string )
112- //keyPrivate := d.Get("key_private").(string)
113111
114112 if len (keyPublic ) == 0 {
115113 public , private , _ := utils .SSHKeyPair ()
@@ -127,30 +125,30 @@ func resourceMachineCreate(ctx context.Context, d *schema.ResourceData, m interf
127125 d .Set ("instance_name" , instanceName )
128126 }
129127
130- driver := d .Get ("driver " ).(string )
128+ cloud := d .Get ("cloud " ).(string )
131129
132- if driver == "aws" {
130+ if cloud == "aws" {
133131 return aws .ResourceMachineCreate (ctx , d , m )
134132 }
135133
136- if driver == "azure" {
134+ if cloud == "azure" {
137135 return azure .ResourceMachineCreate (ctx , d , m )
138136 }
139137
140138 diags = append (diags , diag.Diagnostic {
141139 Severity : diag .Error ,
142- Summary : fmt .Sprintf ("Unknown provider : %s" , driver ),
140+ Summary : fmt .Sprintf ("Unknown cloud : %s" , cloud ),
143141 })
144142 return diags
145143}
146144
147145func resourceMachineDelete (ctx context.Context , d * schema.ResourceData , m interface {}) diag.Diagnostics {
148- driver := d .Get ("driver " ).(string )
149- if driver == "aws" {
146+ cloud := d .Get ("cloud " ).(string )
147+ if cloud == "aws" {
150148 return aws .ResourceMachineDelete (ctx , d , m )
151149 }
152150
153- if driver == "azure" {
151+ if cloud == "azure" {
154152 return azure .ResourceMachineDelete (ctx , d , m )
155153 }
156154
0 commit comments