return default region list from backend

This commit is contained in:
Mitsuhiro Tanda
2018-10-16 12:06:57 +09:00
parent a417d6fa21
commit fce50cf1b8
2 changed files with 17 additions and 35 deletions

View File

@@ -41,32 +41,7 @@ export class CloudWatchConfigCtrl {
{ name: 'Yearly', value: 'Yearly', example: '[logstash-]YYYY' },
];
regions = [
'ap-northeast-1',
'ap-northeast-2',
'ap-northeast-3',
'ap-south-1',
'ap-southeast-1',
'ap-southeast-2',
'ca-central-1',
'cn-north-1',
'cn-northwest-1',
'eu-central-1',
'eu-north-1',
'eu-west-1',
'eu-west-2',
'eu-west-3',
'me-south-1',
'sa-east-1',
'us-east-1',
'us-east-2',
'us-gov-east-1',
'us-gov-west-1',
'us-iso-east-1',
'us-isob-east-1',
'us-west-1',
'us-west-2',
];
regions = [];
getRegions() {
this.datasourceSrv
@@ -74,10 +49,13 @@ export class CloudWatchConfigCtrl {
.then(ds => {
return ds.getRegions();
})
.then(regions => {
this.regions = _.map(regions, 'value');
}, err => {
console.error('failed to call ec2:DescribeRegions, please check iam setting');
});
.then(
regions => {
this.regions = _.map(regions, 'value');
},
err => {
console.error('failed to get latest regions');
}
);
}
}