doc.go 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. // Package sts provides the client and types for making API
  3. // requests to AWS Security Token Service.
  4. //
  5. // The AWS Security Token Service (STS) is a web service that enables you to
  6. // request temporary, limited-privilege credentials for AWS Identity and Access
  7. // Management (IAM) users or for users that you authenticate (federated users).
  8. // This guide provides descriptions of the STS API. For more detailed information
  9. // about using this service, go to Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html).
  10. //
  11. // As an alternative to using the API, you can use one of the AWS SDKs, which
  12. // consist of libraries and sample code for various programming languages and
  13. // platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs provide a convenient
  14. // way to create programmatic access to STS. For example, the SDKs take care
  15. // of cryptographically signing requests, managing errors, and retrying requests
  16. // automatically. For information about the AWS SDKs, including how to download
  17. // and install them, see the Tools for Amazon Web Services page (http://aws.amazon.com/tools/).
  18. //
  19. // For information about setting up signatures and authorization through the
  20. // API, go to Signing AWS API Requests (http://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html)
  21. // in the AWS General Reference. For general information about the Query API,
  22. // go to Making Query Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html)
  23. // in Using IAM. For information about using security tokens with other AWS
  24. // products, go to AWS Services That Work with IAM (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html)
  25. // in the IAM User Guide.
  26. //
  27. // If you're new to AWS and need additional technical information about a specific
  28. // AWS product, you can find the product's technical documentation at http://aws.amazon.com/documentation/
  29. // (http://aws.amazon.com/documentation/).
  30. //
  31. // Endpoints
  32. //
  33. // The AWS Security Token Service (STS) has a default endpoint of https://sts.amazonaws.com
  34. // that maps to the US East (N. Virginia) region. Additional regions are available
  35. // and are activated by default. For more information, see Activating and Deactivating
  36. // AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
  37. // in the IAM User Guide.
  38. //
  39. // For information about STS endpoints, see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#sts_region)
  40. // in the AWS General Reference.
  41. //
  42. // Recording API requests
  43. //
  44. // STS supports AWS CloudTrail, which is a service that records AWS calls for
  45. // your AWS account and delivers log files to an Amazon S3 bucket. By using
  46. // information collected by CloudTrail, you can determine what requests were
  47. // successfully made to STS, who made the request, when it was made, and so
  48. // on. To learn more about CloudTrail, including how to turn it on and find
  49. // your log files, see the AWS CloudTrail User Guide (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html).
  50. //
  51. // See https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15 for more information on this service.
  52. //
  53. // See sts package documentation for more information.
  54. // https://docs.aws.amazon.com/sdk-for-go/api/service/sts/
  55. //
  56. // Using the Client
  57. //
  58. // To use the client for AWS Security Token Service you will first need
  59. // to create a new instance of it.
  60. //
  61. // When creating a client for an AWS service you'll first need to have a Session
  62. // already created. The Session provides configuration that can be shared
  63. // between multiple service clients. Additional configuration can be applied to
  64. // the Session and service's client when they are constructed. The aws package's
  65. // Config type contains several fields such as Region for the AWS Region the
  66. // client should make API requests too. The optional Config value can be provided
  67. // as the variadic argument for Sessions and client creation.
  68. //
  69. // Once the service's client is created you can use it to make API requests the
  70. // AWS service. These clients are safe to use concurrently.
  71. //
  72. // // Create a session to share configuration, and load external configuration.
  73. // sess := session.Must(session.NewSession())
  74. //
  75. // // Create the service's client with the session.
  76. // svc := sts.New(sess)
  77. //
  78. // See the SDK's documentation for more information on how to use service clients.
  79. // https://docs.aws.amazon.com/sdk-for-go/api/
  80. //
  81. // See aws package's Config type for more information on configuration options.
  82. // https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
  83. //
  84. // See the AWS Security Token Service client STS for more
  85. // information on creating the service's client.
  86. // https://docs.aws.amazon.com/sdk-for-go/api/service/sts/#New
  87. //
  88. // Once the client is created you can make an API request to the service.
  89. // Each API method takes a input parameter, and returns the service response
  90. // and an error.
  91. //
  92. // The API method will document which error codes the service can be returned
  93. // by the operation if the service models the API operation's errors. These
  94. // errors will also be available as const strings prefixed with "ErrCode".
  95. //
  96. // result, err := svc.AssumeRole(params)
  97. // if err != nil {
  98. // // Cast err to awserr.Error to handle specific error codes.
  99. // aerr, ok := err.(awserr.Error)
  100. // if ok && aerr.Code() == <error code to check for> {
  101. // // Specific error code handling
  102. // }
  103. // return err
  104. // }
  105. //
  106. // fmt.Println("AssumeRole result:")
  107. // fmt.Println(result)
  108. //
  109. // Using the Client with Context
  110. //
  111. // The service's client also provides methods to make API requests with a Context
  112. // value. This allows you to control the timeout, and cancellation of pending
  113. // requests. These methods also take request Option as variadic parameter to apply
  114. // additional configuration to the API request.
  115. //
  116. // ctx := context.Background()
  117. //
  118. // result, err := svc.AssumeRoleWithContext(ctx, params)
  119. //
  120. // See the request package documentation for more information on using Context pattern
  121. // with the SDK.
  122. // https://docs.aws.amazon.com/sdk-for-go/api/aws/request/
  123. package sts