having issue creating AWS Elastic with VPC via API call

William Flow March 16, 2023

Ok  so here is my issue:

using Post Man i am try to write code that will 

Create elastic image configuration, it does work but i need to use a VPC when I spec out the VPC in subnets i get an error

 

This works:

{
  "configurationName": "Test-bill2",
  "configurationDescription": "AAP Test",
  "imageId": "ami-0ebba1413ed727061",
  "ebsEnabled": false,
  "instanceType": "M3Large",
  "product": "Linux/UNIX",
  "architecture": "x86_64",
  "region": "us-gov-west-1",
}
The problem is i use a VPC and I can't see where i set that so I tried:

{
  "configurationName": "Test-bill3",
  "configurationDescription": "AAP Test",
  "imageId": "ami-0ebba1413ed727061",
  "ebsEnabled": false,
  "instanceType": "M3Large",
  "product": "Linux/UNIX",
  "architecture": "x86_64",
  "region": "us-gov-west-1",
  "subnetIds": [
    "subnet-88c0f4ec"
  ]
}
and i get back
{
    "message": "Unrecognized field \"subnetIds\" (Class com.atlassian.bamboo.plugins.rest.model.elasticConfig.RestElasticImageConfig), not marked as ignorable\n at [Source: org.apache.catalina.connector.CoyoteInputStream@3fe18880; line: 10, column: 17] (through reference chain: com.atlassian.bamboo.plugins.rest.model.elasticConfig.RestElasticImageConfig[\"subnetIds\"])",
    "status-code": 400
}
i also tried setting the subnet to the VPC still no joy and cant find any examples
Thanks in advance

Bill

1 answer

1 accepted

1 vote
Answer accepted
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 16, 2023

Hello @William Flow

There's a bug in the REST API documentation, please use "subnetId" instead (singular). It is also the case in "availabilityZone".

You always call a GET o the "/rest/api/latest/elasticConfiguration" endpoint to list all the available options and their format.

Thank you,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

William Flow March 16, 2023

no joy but get a different error body i sent

{
  "configurationName": "Test-bill67",
  "configurationDescription": "AAP Test",
  "imageId": "ami-0ebba1413ed727061",
  "ebsEnabled": false,
  "instanceType": "M3Large",
  "product": "Linux/UNIX",
  "architecture": "x86_64",
  "region": "us-gov-west-1",
  "subnetId": [
    "subnet-3ac9fd5e"
  ],
  "availabilityZone": [
    "us-gov-west-1a"
  ]
}
got back 
{
    "message": "Can not deserialize instance of java.lang.String out of START_ARRAY token\n at [Source: org.apache.catalina.connector.CoyoteInputStream@3fe18880; line: 9, column: 28] (through reference chain: com.atlassian.bamboo.plugins.rest.model.elasticConfig.RestElasticImageConfig[\"subnetId\"])",
    "status-code": 400
}
William Flow March 16, 2023

never mind I fixed it this works

 

{
  "configurationName": "Test-bill68",
  "configurationDescription": "AAP Test",
  "imageId": "ami-0ebba1413ed727061",
  "ebsEnabled": false,
  "instanceType": "M3Large",
  "product": "Linux/UNIX",
  "architecture": "x86_64",
  "region": "us-gov-west-1",
  "availabilityZone": "us-gov-west-1a,us-gov-west-1b",
  "subnetId": "subnet-88c0f4ec,subnet-63764615"
}
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 17, 2023

Hello @William Flow 

Thanks for reporting that. We have opened a bug to track that fix. You can watch it to follow its progress.

Cheers,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Like Steffen Opel _Utoolity_ likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events