@@ -41,6 +41,12 @@ func ResourceServer() *schema.Resource {
4141 Required : true ,
4242 ForceNew : true ,
4343 },
44+ "enable_vpc" : {
45+ Type : schema .TypeBool ,
46+ Optional : true ,
47+ Default : false ,
48+ Description : "Whether or not to enable VPC access" ,
49+ },
4450 // Computed
4551 "ip" : {
4652 Type : schema .TypeString ,
@@ -72,6 +78,11 @@ func ResourceServer() *schema.Resource {
7278 Computed : true ,
7379 Description : "The minimal date and time on which you can delete this server due to Apple licence" ,
7480 },
81+ "vpc_status" : {
82+ Type : schema .TypeString ,
83+ Computed : true ,
84+ Description : "The VPC status of the server" ,
85+ },
7586
7687 // Common
7788 "zone" : zonal .Schema (),
@@ -91,6 +102,7 @@ func ResourceAppleSiliconServerCreate(ctx context.Context, d *schema.ResourceDat
91102 Name : types .ExpandOrGenerateString (d .Get ("name" ), "m1" ),
92103 Type : d .Get ("type" ).(string ),
93104 ProjectID : d .Get ("project_id" ).(string ),
105+ EnableVpc : d .Get ("enable_vpc" ).(bool ),
94106 }
95107
96108 res , err := asAPI .CreateServer (createReq , scw .WithContext (ctx ))
@@ -134,6 +146,7 @@ func ResourceAppleSiliconServerRead(ctx context.Context, d *schema.ResourceData,
134146 _ = d .Set ("deletable_at" , res .DeletableAt .Format (time .RFC3339 ))
135147 _ = d .Set ("ip" , res .IP .String ())
136148 _ = d .Set ("vnc_url" , res .VncURL )
149+ _ = d .Set ("vpc_status" , res .VpcStatus )
137150
138151 _ = d .Set ("zone" , res .Zone .String ())
139152 _ = d .Set ("organization_id" , res .OrganizationID )
@@ -157,6 +170,11 @@ func ResourceAppleSiliconServerUpdate(ctx context.Context, d *schema.ResourceDat
157170 req .Name = types .ExpandStringPtr (d .Get ("name" ))
158171 }
159172
173+ if d .HasChange ("enable_vpc" ) {
174+ enableVpc := d .Get ("enable_vpc" ).(bool )
175+ req .EnableVpc = & enableVpc
176+ }
177+
160178 _ , err = asAPI .UpdateServer (req , scw .WithContext (ctx ))
161179 if err != nil {
162180 return diag .FromErr (err )
0 commit comments