Amazon AWS SDK Guide de l'utilisateur Page 17 : AWS Region Selection
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
Although you can reference a profile programmatically by using
Amazon.Runtime.StoredProfileAWSCredentials
, we recommend that you use the
aws
element
instead. The following example references a profile named
development
and uses it to create an
AmazonS3Client
object.
AWSCredentials credentials = new StoredProfileAWSCredentials("development");
IAmazonS3 s3Client = new AmazonS3Client(credentials, RegionEndpoint.USWest2);
Tip
If you want to use the default profile, omit the
AWSCredentials
object, and the SDK for .NET
will automatically use your default credentials to create the client object.
Specifying Roles or Temporary Credentials
For applications that run on Amazon EC2 instances, the most secure way to manage credentials is to
use
IAM roles for EC2 Instances
. See the following topic for more information.
•
Using IAM Roles for EC2 Instances with the SDK for .NET (p. 108)
For application scenarios in which the software executable will be available to users outside your
organization, we recommend that you design the software to use
temporary security credentials
. In
addition to providing restricted access to AWS resources, these credentials have the benefit of expiring
after a specified period of time. For more information about temporary security credentials, go to:
•
Using Security Tokens to Grant Temporary Access to Your AWS Resources
•
Authenticating Users of AWS Mobile Applications with a Token Vending Machine
.
Although the title of the second article above refers specifically to mobile applications, the article itself
contains information that is useful for any AWS application that is deployed outside of your organization.
Using Proxy Credentials
If your software communicates with AWS through a proxy, you could specify credentials for the proxy
using the
ProxyCredentials
property on the
ClientConfig
class for the service. For example, for Amazon
S3, you could use code similar to the following, where
my-username
and
my-password
are the proxy
username and password specified in a
NetworkCredential
object.
AmazonS3Config config = new AmazonS3Config();
config.ProxyCredentials = new NetworkCredential("my-username", "my-password");
Earlier versions of the SDK used
ProxyUsername
and
ProxyPassword
, but these properties have been
deprecated.
AWS Region Selection
AWS regions allow you to access AWS services that reside physically in a specific geographic region.
This can be useful both for redundancy and to keep your data and applications running close to where
you and your users will access them. To select a particular region, configure the AWS client object with
an endpoint that corresponds to that region.
For example:
Version v2.0.0
13
AWS SDK for .NET Developer Guide
AWS Region Selection
Fichier PDF · ·
Questions sur Amazon AWS SDK
Pas encore de questions sur ce manuel. Posez la première.
Produits connexes et manuels pour Logiciel Amazon AWS SDK
- Logiciel Amazon Redshift Manuel d'utilisateur
(24 pages) - Logiciel Amazon Redshift Manuel d'utilisateur
(11 pages) - Logiciel Amazon AWS SDK Guide de l'utilisateur
(73 pages)