@@ -15,6 +15,8 @@ import (
1515 "github.com/aws/aws-sdk-go-v2/service/athena"
1616 "github.com/aws/aws-sdk-go-v2/service/autoscaling"
1717 "github.com/aws/aws-sdk-go-v2/service/backup"
18+ "github.com/aws/aws-sdk-go-v2/service/batch"
19+ "github.com/aws/aws-sdk-go-v2/service/cloudformation"
1820 "github.com/aws/aws-sdk-go-v2/service/cloudfront"
1921 "github.com/aws/aws-sdk-go-v2/service/cloudtrail"
2022 "github.com/aws/aws-sdk-go-v2/service/cloudwatch"
@@ -52,20 +54,23 @@ import (
5254 "github.com/aws/aws-sdk-go-v2/service/kinesis"
5355 "github.com/aws/aws-sdk-go-v2/service/kms"
5456 "github.com/aws/aws-sdk-go-v2/service/lambda"
57+ "github.com/aws/aws-sdk-go-v2/service/lightsail"
5558 "github.com/aws/aws-sdk-go-v2/service/macie2"
5659 "github.com/aws/aws-sdk-go-v2/service/memorydb"
5760 "github.com/aws/aws-sdk-go-v2/service/mq"
5861 "github.com/aws/aws-sdk-go-v2/service/neptune"
5962 "github.com/aws/aws-sdk-go-v2/service/networkfirewall"
6063 "github.com/aws/aws-sdk-go-v2/service/opensearch"
6164 "github.com/aws/aws-sdk-go-v2/service/organizations"
65+ "github.com/aws/aws-sdk-go-v2/service/pipes"
6266 "github.com/aws/aws-sdk-go-v2/service/rds"
6367 "github.com/aws/aws-sdk-go-v2/service/redshift"
6468 "github.com/aws/aws-sdk-go-v2/service/route53"
6569 "github.com/aws/aws-sdk-go-v2/service/route53domains"
6670 "github.com/aws/aws-sdk-go-v2/service/s3"
6771 "github.com/aws/aws-sdk-go-v2/service/s3control"
6872 "github.com/aws/aws-sdk-go-v2/service/sagemaker"
73+ "github.com/aws/aws-sdk-go-v2/service/scheduler"
6974 "github.com/aws/aws-sdk-go-v2/service/secretsmanager"
7075 "github.com/aws/aws-sdk-go-v2/service/securityhub"
7176 "github.com/aws/aws-sdk-go-v2/service/shield"
@@ -1801,3 +1806,103 @@ func (t *AwsConnection) ElasticBeanstalk(region string) *elasticbeanstalk.Client
18011806 t .clientcache .Store (cacheVal , & CacheEntry {Data : client })
18021807 return client
18031808}
1809+
1810+ func (t * AwsConnection ) Batch (region string ) * batch.Client {
1811+ if len (region ) == 0 {
1812+ region = t .cfg .Region
1813+ }
1814+ cacheVal := "_batch_" + region
1815+
1816+ c , ok := t .clientcache .Load (cacheVal )
1817+ if ok {
1818+ log .Debug ().Msg ("use cached batch client" )
1819+ return c .Data .(* batch.Client )
1820+ }
1821+
1822+ cfg := t .cfg .Copy ()
1823+ cfg .Region = region
1824+ client := batch .NewFromConfig (cfg )
1825+
1826+ t .clientcache .Store (cacheVal , & CacheEntry {Data : client })
1827+ return client
1828+ }
1829+
1830+ func (t * AwsConnection ) CloudFormation (region string ) * cloudformation.Client {
1831+ if len (region ) == 0 {
1832+ region = t .cfg .Region
1833+ }
1834+ cacheVal := "_cloudformation_" + region
1835+
1836+ c , ok := t .clientcache .Load (cacheVal )
1837+ if ok {
1838+ log .Debug ().Msg ("use cached cloudformation client" )
1839+ return c .Data .(* cloudformation.Client )
1840+ }
1841+
1842+ cfg := t .cfg .Copy ()
1843+ cfg .Region = region
1844+ client := cloudformation .NewFromConfig (cfg )
1845+
1846+ t .clientcache .Store (cacheVal , & CacheEntry {Data : client })
1847+ return client
1848+ }
1849+
1850+ func (t * AwsConnection ) Lightsail (region string ) * lightsail.Client {
1851+ if len (region ) == 0 {
1852+ region = t .cfg .Region
1853+ }
1854+ cacheVal := "_lightsail_" + region
1855+
1856+ c , ok := t .clientcache .Load (cacheVal )
1857+ if ok {
1858+ log .Debug ().Msg ("use cached lightsail client" )
1859+ return c .Data .(* lightsail.Client )
1860+ }
1861+
1862+ cfg := t .cfg .Copy ()
1863+ cfg .Region = region
1864+ client := lightsail .NewFromConfig (cfg )
1865+
1866+ t .clientcache .Store (cacheVal , & CacheEntry {Data : client })
1867+ return client
1868+ }
1869+
1870+ func (t * AwsConnection ) Pipes (region string ) * pipes.Client {
1871+ if len (region ) == 0 {
1872+ region = t .cfg .Region
1873+ }
1874+ cacheVal := "_pipes_" + region
1875+
1876+ c , ok := t .clientcache .Load (cacheVal )
1877+ if ok {
1878+ log .Debug ().Msg ("use cached pipes client" )
1879+ return c .Data .(* pipes.Client )
1880+ }
1881+
1882+ cfg := t .cfg .Copy ()
1883+ cfg .Region = region
1884+ client := pipes .NewFromConfig (cfg )
1885+
1886+ t .clientcache .Store (cacheVal , & CacheEntry {Data : client })
1887+ return client
1888+ }
1889+
1890+ func (t * AwsConnection ) Scheduler (region string ) * scheduler.Client {
1891+ if len (region ) == 0 {
1892+ region = t .cfg .Region
1893+ }
1894+ cacheVal := "_scheduler_" + region
1895+
1896+ c , ok := t .clientcache .Load (cacheVal )
1897+ if ok {
1898+ log .Debug ().Msg ("use cached scheduler client" )
1899+ return c .Data .(* scheduler.Client )
1900+ }
1901+
1902+ cfg := t .cfg .Copy ()
1903+ cfg .Region = region
1904+ client := scheduler .NewFromConfig (cfg )
1905+
1906+ t .clientcache .Store (cacheVal , & CacheEntry {Data : client })
1907+ return client
1908+ }
0 commit comments